diff --git a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js index 3d4fdd63e3..11f766a1c9 100644 --- a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js +++ b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js @@ -4,7 +4,7 @@ function foo(l) { ); } -function foo() { +function foo2() { return ( 1 && 2 ) || 3; diff --git a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js index eda704040f..494b4cf7d5 100644 --- a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js +++ b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js @@ -4,7 +4,7 @@ function foo(l) { } -function foo() { +function foo2() { return ( 1 && 2 || 3); diff --git a/packages/babel-generator/test/fixtures/flow/implements/input.js b/packages/babel-generator/test/fixtures/flow/implements/input.js index 32acd7162b..0dd3e54589 100644 --- a/packages/babel-generator/test/fixtures/flow/implements/input.js +++ b/packages/babel-generator/test/fixtures/flow/implements/input.js @@ -1,5 +1,5 @@ -class A implements B {} -class A implements B, C {} -declare class A implements B {} -declare class A mixins B implements C {} -declare class A implements B, C {} +class A1 implements B {} +class A2 implements B, C {} +declare class A3 implements B {} +declare class A4 mixins B implements C {} +declare class A5 implements B, C {} diff --git a/packages/babel-generator/test/fixtures/flow/implements/output.js b/packages/babel-generator/test/fixtures/flow/implements/output.js index 6f2f016681..b1bd305e65 100644 --- a/packages/babel-generator/test/fixtures/flow/implements/output.js +++ b/packages/babel-generator/test/fixtures/flow/implements/output.js @@ -1,7 +1,7 @@ -class A implements B {} +class A1 implements B {} -class A implements B, C {} +class A2 implements B, C {} -declare class A implements B {} -declare class A mixins B implements C {} -declare class A implements B, C {} \ No newline at end of file +declare class A3 implements B {} +declare class A4 mixins B implements C {} +declare class A5 implements B, C {} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js index 85decdae35..ea74162102 100644 --- a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js +++ b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js @@ -1,9 +1,9 @@ -interface A {} -interface A extends B {} -interface A extends B, C {} -interface A { foo: () => number; } +interface A1 {} +interface A2 extends B {} +interface A3 extends B, C {} +interface A4 { foo: () => number; } interface Dictionary { [index: string]: string; length: number; } -class Foo implements Bar {} -class Foo extends Bar implements Bat, Man {} -class Foo extends class Bar implements Bat {} {} -class Foo extends class Bar implements Bat {} implements Man {} +class Foo1 implements Bar {} +class Foo2 extends Bar implements Bat, Man {} +class Foo3 extends class Bar implements Bat {} {} +class Foo4 extends class Bar implements Bat {} implements Man {} diff --git a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js index f6f4341fdd..ef7fce8a50 100644 --- a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js +++ b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js @@ -1,7 +1,7 @@ -interface A {} -interface A extends B {} -interface A extends B, C {} -interface A { +interface A1 {} +interface A2 extends B {} +interface A3 extends B, C {} +interface A4 { foo: () => number } interface Dictionary { @@ -9,10 +9,10 @@ interface Dictionary { [index: string]: string, } -class Foo implements Bar {} +class Foo1 implements Bar {} -class Foo extends Bar implements Bat, Man {} +class Foo2 extends Bar implements Bat, Man {} -class Foo extends class Bar implements Bat {} {} +class Foo3 extends class Bar implements Bat {} {} -class Foo extends class Bar implements Bat {} implements Man {} \ No newline at end of file +class Foo4 extends class Bar implements Bat {} implements Man {} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/flow/predicates/input.js b/packages/babel-generator/test/fixtures/flow/predicates/input.js index bbbbe2c8f2..8e614a82f1 100644 --- a/packages/babel-generator/test/fixtures/flow/predicates/input.js +++ b/packages/babel-generator/test/fixtures/flow/predicates/input.js @@ -12,6 +12,6 @@ function is_string(x): boolean %checks { var f = (x: mixed): %checks => typeof x === "string"; -const foo = (x: mixed): boolean %checks => typeof x === "string"; +const foo2 = (x: mixed): boolean %checks => typeof x === "string"; (x): %checks => x !== null; diff --git a/packages/babel-generator/test/fixtures/flow/predicates/output.js b/packages/babel-generator/test/fixtures/flow/predicates/output.js index 23ddac6347..bc1ac228aa 100644 --- a/packages/babel-generator/test/fixtures/flow/predicates/output.js +++ b/packages/babel-generator/test/fixtures/flow/predicates/output.js @@ -12,6 +12,6 @@ function is_string(x): boolean %checks { var f = (x: mixed): %checks => typeof x === "string"; -const foo = (x: mixed): boolean %checks => typeof x === "string"; +const foo2 = (x: mixed): boolean %checks => typeof x === "string"; x: %checks => x !== null; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js b/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js index 6acd7f1342..a804786348 100644 --- a/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js +++ b/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js @@ -1,2 +1,2 @@ -function createElement(tagName: "div"): HTMLDivElement {} -function createElement(tagName: 'div'): HTMLDivElement {} +function createElement1(tagName: "div"): HTMLDivElement {} +function createElement2(tagName: 'div'): HTMLDivElement {} diff --git a/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js b/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js index 97251990f3..523469a5c3 100644 --- a/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js +++ b/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js @@ -1,3 +1,3 @@ -function createElement(tagName: "div"): HTMLDivElement {} +function createElement1(tagName: "div"): HTMLDivElement {} -function createElement(tagName: 'div'): HTMLDivElement {} \ No newline at end of file +function createElement2(tagName: 'div'): HTMLDivElement {} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/flow/type-annotations/input.js b/packages/babel-generator/test/fixtures/flow/type-annotations/input.js index d94dd1ce66..76be1b446f 100644 --- a/packages/babel-generator/test/fixtures/flow/type-annotations/input.js +++ b/packages/babel-generator/test/fixtures/flow/type-annotations/input.js @@ -1,130 +1,130 @@ -function foo(numVal: any) {} -function foo(numVal: number) {} -function foo(numVal: number, strVal: string) {} -function foo(numVal: number, untypedVal) {} -function foo(untypedVal, numVal: number) {} -function foo(nullableNum: ?number) {} -function foo(callback: () => void) {} -function foo(callback: () => number) {} -function foo(callback: (_: bool) => number) {} -function foo(callback: (_1: bool, _2: string) => number) {} -function foo(callback: (_1: bool, ...foo: Array) => number) {} -function foo(): number{} -function foo():() => void {} -function foo():(_:bool) => number{} -function foo():(_?:bool) => number{} -function foo(): {} {} -function foo() {} -function foo() {} -function foo() {} -a = function() {}; -a = { set fooProp(value: number) {} }; -a = { set fooProp(value: number): void {} }; -a = { get fooProp():number{} }; -a = { id(x: T): T {} }; -a = { *id(x: T): T {} }; -a = { async id(x: T): T {} }; -a = { 123(x: T): T {} }; -class Foo { +function foo1(numVal: any) {} +function foo2(numVal: number) {} +function foo3(numVal: number, strVal: string) {} +function foo4(numVal: number, untypedVal) {} +function foo5(untypedVal, numVal: number) {} +function foo6(nullableNum: ?number) {} +function foo7(callback: () => void) {} +function foo8(callback: () => number) {} +function foo9(callback: (_: bool) => number) {} +function foo10(callback: (_1: bool, _2: string) => number) {} +function foo11(callback: (_1: bool, ...foo: Array) => number) {} +function foo12(): number{} +function foo13():() => void {} +function foo14():(_:bool) => number{} +function foo15():(_?:bool) => number{} +function foo16(): {} {} +function foo17() {} +function foo18() {} +function foo19() {} +a1 = function() {}; +a2 = { set fooProp(value: number) {} }; +a3 = { set fooProp(value: number): void {} }; +a4 = { get fooProp():number{} }; +a5 = { id(x: T): T {} }; +a6 = { *id(x: T): T {} }; +a7 = { async id(x: T): T {} }; +a8 = { 123(x: T): T {} }; +class Foo1 { set fooProp(value: number) {} } -class Foo { +class Foo2 { set fooProp(value: number): void {} } -class Foo { +class Foo3 { get fooProp(): number {} } -var numVal: number; -var numVal: empty; -var numVal: mixed; -var numVal: number = otherNumVal; -var a: { numVal: number }; -var a: { numVal: number; }; -var a: { numVal: number; [indexer: string]: number }; -var a: ?{ numVal: number }; -var a: { numVal: number; strVal: string } -var a: { subObj: {strVal: string} } -var a: { subObj: ?{strVal: string} } -var a: { param1: number; param2: string } -var a: { param1: number; param2?: string } -var a: { [a: number]: string; [b: number]: string; }; -var a: { add(x: number, ...y: Array): void }; -var a: { subtract: (x: number, ...y: Array) => void }; -var a: { id(x: T): T; }; -var a:Array = [1, 2, 3] -a = class Foo {} -a = class Foo extends Bar {} -class Foo {} -class Foo extends Bar {} -class Foo extends mixin(Bar) {} -class Foo { +var numVal1: number; +var numVal2: empty; +var numVal3: mixed; +var numVal4: number = otherNumVal; +var a1: { numVal: number }; +var a2: { numVal: number; }; +var a3: { numVal: number; [indexer: string]: number }; +var a4: ?{ numVal: number }; +var a5: { numVal: number; strVal: string } +var a6: { subObj: {strVal: string} } +var a7: { subObj: ?{strVal: string} } +var a8: { param1: number; param2: string } +var a9: { param1: number; param2?: string } +var a10: { [a: number]: string; [b: number]: string; }; +var a11: { add(x: number, ...y: Array): void }; +var a12: { subtract: (x: number, ...y: Array) => void }; +var a13: { id(x: T): T; }; +var a14:Array = [1, 2, 3] +a13 = class Foo {} +a14 = class Foo extends Bar {} +class Foo4 {} +class Foo5 extends Bar {} +class Foo6 extends mixin(Bar) {} +class Foo7 { bar():number { return 42; } } -class Foo { +class Foo8 { "bar"() {} } -function foo(requiredParam, optParam?) {} -class Foo { +function foo20(requiredParam, optParam?) {} +class Foo9 { prop1: string; prop2: number; } -class Foo { +class Foo10 { static prop1: string; prop2: number; } -class Foo { +class Foo11 { #prop1: string; prop2: number; } -var x: number | string = 4; +var x1: number | string = 4; class Array { concat(items:number | string) {}; } -var x: () => number | () => string = fn; -var x: typeof Y = Y; -var x: typeof Y | number = Y; -var {x}: {x: string; } = { x: "hello" }; -var {x}: {x: string } = { x: "hello" }; -var [x]: Array = [ "hello" ]; -function foo({x}: { x: string; }) {} -function foo([x]: Array) {} -function foo(...rest: Array) {} +var x2: () => number | () => string = fn; +var x3: typeof Y = Y; +var x4: typeof Y | number = Y; +var {x5}: {x5: string; } = { x5: "hello" }; +var {x6}: {x6: string } = { x6: "hello" }; +var [x7]: Array = [ "hello" ]; +function foo21({x}: { x: string; }) {} +function foo22([x]: Array) {} +function foo23(...rest: Array) {} (function (...rest: Array) {}); ((...rest: Array) => rest); -var a: Map > -var a: Map> -var a: number[] -var a: ?string[] -var a: Promise[] -var a:(...rest:Array) => number -var identity: (x: T) => T -var identity: (x: T, ...y:T[]) => T -import type foo from "bar"; -import type { foo, bar } from "baz"; -import type { foo as bar } from "baz"; +var a15: Map > +var a16: Map> +var a17: number[] +var a18: ?string[] +var a19: Promise[] +var a20:(...rest:Array) => number +var identity1: (x: T) => T +var identity2: (x: T, ...y:T[]) => T +import type foo24 from "bar"; +import type { foo25, bar1 } from "baz"; +import type { foo as bar2 } from "baz"; import type from "foo"; -import type, { foo } from "bar"; +import type2, { foo26 } from "bar"; import typeof * as namespace from "bar"; -import { type Foo } from "bar"; -import { typeof Foo } from "bar"; -import { type Foo as Bar } from "bar"; -import { typeof Foo as Bar } from "bar"; +import { type Foo12 } from "bar"; +import { typeof Foo13 } from "bar"; +import { type Foo as Bar1 } from "bar"; +import { typeof Foo as Bar2 } from "bar"; export type { foo }; export type { bar } from "bar"; export interface baz { p: number } export interface qux { p: T } -var a: ?Array; -var a: {| numVal: number |}; -var a: {| numVal: number; |}; -var a: {| numVal: number; [indexer: string]: number |}; -var a: ?{| numVal: number |}; -var a: {| numVal: number; strVal: string |} -var a: {| subObj: {strVal: string} |} -var a: {| subObj: ?{strVal: string} |} -var a: {| param1: number; param2: string |} -var a: {| param1: number; param2?: string |} -var a: {| [a: number]: string; [b: number]: string; |}; -var a: {| add(x: number, ...y: Array): void |}; -var a: {| subtract: (x: number, ...y: Array) => void |}; -var a: {| id(x: T): T; |}; -function foo(numVal: number = 2) {} -function foo(numVal?: number = 2) {} +var a21: ?Array; +var a22: {| numVal: number |}; +var a23: {| numVal: number; |}; +var a24: {| numVal: number; [indexer: string]: number |}; +var a25: ?{| numVal: number |}; +var a26: {| numVal: number; strVal: string |} +var a27: {| subObj: {strVal: string} |} +var a28: {| subObj: ?{strVal: string} |} +var a29: {| param1: number; param2: string |} +var a30: {| param1: number; param2?: string |} +var a31: {| [a: number]: string; [b: number]: string; |}; +var a32: {| add(x: number, ...y: Array): void |}; +var a33: {| subtract: (x: number, ...y: Array) => void |}; +var a34: {| id(x: T): T; |}; +function foo27(numVal: number = 2) {} +function foo28(numVal?: number = 2) {} export type * from "foo"; diff --git a/packages/babel-generator/test/fixtures/flow/type-annotations/output.js b/packages/babel-generator/test/fixtures/flow/type-annotations/output.js index 89259e8661..cd69710614 100644 --- a/packages/babel-generator/test/fixtures/flow/type-annotations/output.js +++ b/packages/babel-generator/test/fixtures/flow/type-annotations/output.js @@ -1,236 +1,236 @@ -function foo(numVal: any) {} +function foo1(numVal: any) {} -function foo(numVal: number) {} +function foo2(numVal: number) {} -function foo(numVal: number, strVal: string) {} +function foo3(numVal: number, strVal: string) {} -function foo(numVal: number, untypedVal) {} +function foo4(numVal: number, untypedVal) {} -function foo(untypedVal, numVal: number) {} +function foo5(untypedVal, numVal: number) {} -function foo(nullableNum: ?number) {} +function foo6(nullableNum: ?number) {} -function foo(callback: () => void) {} +function foo7(callback: () => void) {} -function foo(callback: () => number) {} +function foo8(callback: () => number) {} -function foo(callback: (_: boolean) => number) {} +function foo9(callback: (_: boolean) => number) {} -function foo(callback: (_1: boolean, _2: string) => number) {} +function foo10(callback: (_1: boolean, _2: string) => number) {} -function foo(callback: (_1: boolean, ...foo: Array) => number) {} +function foo11(callback: (_1: boolean, ...foo: Array) => number) {} -function foo(): number {} +function foo12(): number {} -function foo(): () => void {} +function foo13(): () => void {} -function foo(): (_: boolean) => number {} +function foo14(): (_: boolean) => number {} -function foo(): (_?: boolean) => number {} +function foo15(): (_?: boolean) => number {} -function foo(): {} {} +function foo16(): {} {} -function foo() {} +function foo17() {} -function foo() {} +function foo18() {} -function foo() {} +function foo19() {} -a = function () {}; +a1 = function () {}; -a = { +a2 = { set fooProp(value: number) {} }; -a = { +a3 = { set fooProp(value: number): void {} }; -a = { +a4 = { get fooProp(): number {} }; -a = { +a5 = { id(x: T): T {} }; -a = { +a6 = { *id(x: T): T {} }; -a = { +a7 = { async id(x: T): T {} }; -a = { +a8 = { 123(x: T): T {} }; -class Foo { +class Foo1 { set fooProp(value: number) {} } -class Foo { +class Foo2 { set fooProp(value: number): void {} } -class Foo { +class Foo3 { get fooProp(): number {} } -var numVal: number; -var numVal: empty; -var numVal: mixed; -var numVal: number = otherNumVal; -var a: { +var numVal1: number; +var numVal2: empty; +var numVal3: mixed; +var numVal4: number = otherNumVal; +var a1: { numVal: number }; -var a: { +var a2: { numVal: number }; -var a: { +var a3: { numVal: number, [indexer: string]: number, }; -var a: ?{ +var a4: ?{ numVal: number }; -var a: { +var a5: { numVal: number, strVal: string, }; -var a: { +var a6: { subObj: { strVal: string } }; -var a: { +var a7: { subObj: ?{ strVal: string } }; -var a: { +var a8: { param1: number, param2: string, }; -var a: { +var a9: { param1: number, param2?: string, }; -var a: { +var a10: { [a: number]: string, [b: number]: string, }; -var a: { +var a11: { add(x: number, ...y: Array): void }; -var a: { +var a12: { subtract: (x: number, ...y: Array) => void }; -var a: { +var a13: { id(x: T): T }; -var a: Array = [1, 2, 3]; -a = class Foo {}; -a = class Foo extends Bar {}; +var a14: Array = [1, 2, 3]; +a13 = class Foo {}; +a14 = class Foo extends Bar {}; -class Foo {} +class Foo4 {} -class Foo extends Bar {} +class Foo5 extends Bar {} -class Foo extends mixin(Bar) {} +class Foo6 extends mixin(Bar) {} -class Foo { +class Foo7 { bar(): number { return 42; } } -class Foo { +class Foo8 { "bar"() {} } -function foo(requiredParam, optParam?) {} +function foo20(requiredParam, optParam?) {} -class Foo { +class Foo9 { prop1: string; prop2: number; } -class Foo { +class Foo10 { static prop1: string; prop2: number; } -class Foo { +class Foo11 { #prop1: string; prop2: number; } -var x: number | string = 4; +var x1: number | string = 4; class Array { concat(items: number | string) {} } -var x: () => number | (() => string) = fn; -var x: typeof Y = Y; -var x: typeof Y | number = Y; +var x2: () => number | (() => string) = fn; +var x3: typeof Y = Y; +var x4: typeof Y | number = Y; var { - x + x5 }: { - x: string + x5: string } = { - x: "hello" + x5: "hello" }; var { - x + x6 }: { - x: string + x6: string } = { - x: "hello" + x6: "hello" }; -var [x]: Array = ["hello"]; +var [x7]: Array = ["hello"]; -function foo({ +function foo21({ x }: { x: string }) {} -function foo([x]: Array) {} +function foo22([x]: Array) {} -function foo(...rest: Array) {} +function foo23(...rest: Array) {} (function (...rest: Array) {}); (...rest: Array) => rest; -var a: Map>; -var a: Map>; -var a: number[]; -var a: ?string[]; -var a: Promise[]; -var a: (...rest: Array) => number; -var identity: (x: T) => T; -var identity: (x: T, ...y: T[]) => T; -import type foo from "bar"; -import type { foo, bar } from "baz"; -import type { foo as bar } from "baz"; +var a15: Map>; +var a16: Map>; +var a17: number[]; +var a18: ?string[]; +var a19: Promise[]; +var a20: (...rest: Array) => number; +var identity1: (x: T) => T; +var identity2: (x: T, ...y: T[]) => T; +import type foo24 from "bar"; +import type { foo25, bar1 } from "baz"; +import type { foo as bar2 } from "baz"; import type from "foo"; -import type, { foo } from "bar"; +import type2, { foo26 } from "bar"; import typeof * as namespace from "bar"; -import { type Foo } from "bar"; -import { typeof Foo } from "bar"; -import { type Foo as Bar } from "bar"; -import { typeof Foo as Bar } from "bar"; +import { type Foo12 } from "bar"; +import { typeof Foo13 } from "bar"; +import { type Foo as Bar1 } from "bar"; +import { typeof Foo as Bar2 } from "bar"; export type { foo }; export type { bar } from "bar"; export interface baz { @@ -239,58 +239,58 @@ export interface baz { export interface qux { p: T } -var a: ?Array; -var a: {| +var a21: ?Array; +var a22: {| numVal: number |}; -var a: {| +var a23: {| numVal: number |}; -var a: {| +var a24: {| numVal: number, [indexer: string]: number, |}; -var a: ?{| +var a25: ?{| numVal: number |}; -var a: {| +var a26: {| numVal: number, strVal: string, |}; -var a: {| +var a27: {| subObj: { strVal: string } |}; -var a: {| +var a28: {| subObj: ?{ strVal: string } |}; -var a: {| +var a29: {| param1: number, param2: string, |}; -var a: {| +var a30: {| param1: number, param2?: string, |}; -var a: {| +var a31: {| [a: number]: string, [b: number]: string, |}; -var a: {| +var a32: {| add(x: number, ...y: Array): void |}; -var a: {| +var a33: {| subtract: (x: number, ...y: Array) => void |}; -var a: {| +var a34: {| id(x: T): T |}; -function foo(numVal: number = 2) {} +function foo27(numVal: number = 2) {} -function foo(numVal?: number = 2) {} +function foo28(numVal?: number = 2) {} -export type * from "foo"; \ No newline at end of file +export type * from "foo"; diff --git a/packages/babel-generator/test/fixtures/flow/type-parameters/input.js b/packages/babel-generator/test/fixtures/flow/type-parameters/input.js index a995d06499..5d0b94ca15 100644 --- a/packages/babel-generator/test/fixtures/flow/type-parameters/input.js +++ b/packages/babel-generator/test/fixtures/flow/type-parameters/input.js @@ -1,21 +1,21 @@ -type A = T; -type A = T; -type A = T; -type A = T; -type A = T; -class A {} -class A {} -class A {} -class A {} -(class A {}); -(class A {}); -(class A {}); -(class A {}); -declare class A {} -declare class A {} -declare class A {} -declare class A {} -interface A {} -interface A {} -interface A {} -interface A {} +type A1 = T; +type A2 = T; +type A3 = T; +type A4 = T; +type A5 = T; +class A6 {} +class A7 {} +class A8 {} +class A9 {} +(class A10 {}); +(class A11 {}); +(class A12 {}); +(class A13 {}); +declare class A14 {} +declare class A15 {} +declare class A16 {} +declare class A17 {} +interface A18 {} +interface A19 {} +interface A20 {} +interface A21 {} diff --git a/packages/babel-generator/test/fixtures/flow/type-parameters/output.js b/packages/babel-generator/test/fixtures/flow/type-parameters/output.js index f447788449..768f82b1fe 100644 --- a/packages/babel-generator/test/fixtures/flow/type-parameters/output.js +++ b/packages/babel-generator/test/fixtures/flow/type-parameters/output.js @@ -1,30 +1,30 @@ -type A = T; -type A = T; -type A = T; -type A = T; -type A = T; +type A1 = T; +type A2 = T; +type A3 = T; +type A4 = T; +type A5 = T; -class A {} +class A6 {} -class A {} +class A7 {} -class A {} +class A8 {} -class A {} +class A9 {} -(class A {}); +(class A10 {}); -(class A {}); +(class A11 {}); -(class A {}); +(class A12 {}); -(class A {}); +(class A13 {}); -declare class A {} -declare class A {} -declare class A {} -declare class A {} -interface A {} -interface A {} -interface A {} -interface A {} \ No newline at end of file +declare class A14 {} +declare class A15 {} +declare class A16 {} +declare class A17 {} +interface A18 {} +interface A19 {} +interface A20 {} +interface A21 {} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/input.js b/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/input.js index b9325bbae1..a198e51600 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/input.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/input.js @@ -4,15 +4,15 @@ function t2({responseText}) { } function t3([a, b]) { } -var [i, j, k] = array; +var [i1, j1, k1] = array; var { - i, - j, - k + i2, + j2, + k2 } = obj; -let {i, j, k} = obj; -const {i, j, k} = obj; -var { value } = obj; +let {i3, j3, k3} = obj; +const {i4, j4, k4} = obj; +var { value1 } = obj; var { - value + value2 } = obj; diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/output.js b/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/output.js index 8c09588f29..65da4d30e4 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/output.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/destructuring-assignment/output.js @@ -8,25 +8,25 @@ function t2({ function t3([a, b]) {} -var [i, j, k] = array; +var [i1, j1, k1] = array; var { - i, - j, - k + i2, + j2, + k2 } = obj; let { - i, - j, - k + i3, + j3, + k3 } = obj; const { - i, - j, - k + i4, + j4, + k4 } = obj; var { - value + value1 } = obj; var { - value + value2 } = obj; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/input.js b/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/input.js index 7fb048846d..0b3e895ed0 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/input.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/input.js @@ -1,5 +1,5 @@ -import foo from "foo"; -import * as foo from "foo"; +import foo1 from "foo"; +import * as foo2 from "foo"; import ok, { foo as bar, test as testing, diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/output.js b/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/output.js index 26bcdddc45..0cc3e04720 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/output.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/import-with-default/output.js @@ -1,3 +1,3 @@ -import foo from "foo"; -import * as foo from "foo"; +import foo1 from "foo"; +import * as foo2 from "foo"; import ok, { foo as bar, test as testing, logging } from "foo"; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/imports/input.js b/packages/babel-generator/test/fixtures/harmony-edgecase/imports/input.js index 98bbc6bbcb..db91fc8028 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/imports/input.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/imports/input.js @@ -1,8 +1,8 @@ import "foo"; import {foo} from "foo"; -import {foo as bar} from "foo"; +import {foo as bar1} from "foo"; import { - foo as bar, + foo as bar2, test as testing, logging } from "foo"; diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/imports/output.js b/packages/babel-generator/test/fixtures/harmony-edgecase/imports/output.js index 2406027fa3..651af1c0fe 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/imports/output.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/imports/output.js @@ -1,4 +1,4 @@ import "foo"; import { foo } from "foo"; -import { foo as bar } from "foo"; -import { foo as bar, test as testing, logging } from "foo"; \ No newline at end of file +import { foo as bar1 } from "foo"; +import { foo as bar2, test as testing, logging } from "foo"; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/input.js b/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/input.js index c4cd936913..6e3396d156 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/input.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/input.js @@ -1,5 +1,5 @@ -var [a, b, ...rest] = array; -const [a, b, ...rest] = array; -function a([a, b, ...rest]) { +var [a1, b1, ...rest1] = array; +const [a2, b2, ...rest2] = array; +function a([a1, b1, ...rest1]) { } -([a, b, ...rest]) => { }; +([a1, b1, ...rest1]) => { }; diff --git a/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/output.js b/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/output.js index d378ae9244..070fa55a1f 100644 --- a/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/output.js +++ b/packages/babel-generator/test/fixtures/harmony-edgecase/spread-element/output.js @@ -1,6 +1,6 @@ -var [a, b, ...rest] = array; -const [a, b, ...rest] = array; +var [a1, b1, ...rest1] = array; +const [a2, b2, ...rest2] = array; -function a([a, b, ...rest]) {} +function a([a1, b1, ...rest1]) {} -([a, b, ...rest]) => {}; \ No newline at end of file +([a1, b1, ...rest1]) => {}; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/parentheses/class-extends/input.js b/packages/babel-generator/test/fixtures/parentheses/class-extends/input.js index 308200e8d2..23e941a3b1 100644 --- a/packages/babel-generator/test/fixtures/parentheses/class-extends/input.js +++ b/packages/babel-generator/test/fixtures/parentheses/class-extends/input.js @@ -1,22 +1,22 @@ -class A extends (() => {}) {} -class A extends (B = C) {} -class A extends (B || C) {} -class A extends (B + C) {} -class A extends B() {} -class A extends class {} {} -class A extends (B ? C : D) {} -class A extends (new B()) {} -class A extends (B, C) {} -class A extends ({}) {} -class A extends B.C {} -class A extends function() {} {} -class A extends (void B) {} -class A extends (++B) {} +class A1 extends (() => {}) {} +class A2 extends (B = C) {} +class A3 extends (B || C) {} +class A4 extends (B + C) {} +class A5 extends B() {} +class A6 extends class {} {} +class A7 extends (B ? C : D) {} +class A8 extends (new B()) {} +class A9 extends (B, C) {} +class A10 extends ({}) {} +class A11 extends B.C {} +class A12 extends function() {} {} +class A13 extends (void B) {} +class A14 extends (++B) {} -async function f() { - class A extends (await C) {} +async function f1() { + class A15 extends (await C) {} } -function* f() { - class A extends (yield 1) {} +function* f2() { + class A16 extends (yield 1) {} } diff --git a/packages/babel-generator/test/fixtures/parentheses/class-extends/output.js b/packages/babel-generator/test/fixtures/parentheses/class-extends/output.js index 4b67a09f7e..a898c15b5a 100644 --- a/packages/babel-generator/test/fixtures/parentheses/class-extends/output.js +++ b/packages/babel-generator/test/fixtures/parentheses/class-extends/output.js @@ -1,35 +1,35 @@ -class A extends (() => {}) {} +class A1 extends (() => {}) {} -class A extends (B = C) {} +class A2 extends (B = C) {} -class A extends (B || C) {} +class A3 extends (B || C) {} -class A extends (B + C) {} +class A4 extends (B + C) {} -class A extends B() {} +class A5 extends B() {} -class A extends class {} {} +class A6 extends class {} {} -class A extends (B ? C : D) {} +class A7 extends (B ? C : D) {} -class A extends (new B()) {} +class A8 extends (new B()) {} -class A extends (B, C) {} +class A9 extends (B, C) {} -class A extends {} {} +class A10 extends {} {} -class A extends B.C {} +class A11 extends B.C {} -class A extends function () {} {} +class A12 extends function () {} {} -class A extends (void B) {} +class A13 extends (void B) {} -class A extends (++B) {} +class A14 extends (++B) {} -async function f() { - class A extends (await C) {} +async function f1() { + class A15 extends (await C) {} } -function* f() { - class A extends (yield 1) {} +function* f2() { + class A16 extends (yield 1) {} } \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/parentheses/terminator-break/input.js b/packages/babel-generator/test/fixtures/parentheses/terminator-break/input.js index ad3ad2eecf..b7fe375717 100644 --- a/packages/babel-generator/test/fixtures/parentheses/terminator-break/input.js +++ b/packages/babel-generator/test/fixtures/parentheses/terminator-break/input.js @@ -1,10 +1,10 @@ -function foo() { +function foo1() { return ( // foobar "bar" ); } -function foo() { +function foo2() { return ( // foobar "bar" diff --git a/packages/babel-generator/test/fixtures/parentheses/terminator-break/output.js b/packages/babel-generator/test/fixtures/parentheses/terminator-break/output.js index 1267e861f3..7ec6459a0d 100644 --- a/packages/babel-generator/test/fixtures/parentheses/terminator-break/output.js +++ b/packages/babel-generator/test/fixtures/parentheses/terminator-break/output.js @@ -1,10 +1,10 @@ -function foo() { +function foo1() { return (// foobar "bar" ); } -function foo() { +function foo2() { return (// foobar "bar" ); diff --git a/packages/babel-generator/test/fixtures/types/ClassExpression/input.js b/packages/babel-generator/test/fixtures/types/ClassExpression/input.js index 1931f1faea..195044c70d 100644 --- a/packages/babel-generator/test/fixtures/types/ClassExpression/input.js +++ b/packages/babel-generator/test/fixtures/types/ClassExpression/input.js @@ -1,2 +1,2 @@ class Foo {} -class Foo extends Bar {} +class Foo2 extends Bar {} diff --git a/packages/babel-generator/test/fixtures/types/ClassExpression/output.js b/packages/babel-generator/test/fixtures/types/ClassExpression/output.js index 5355e2a5ed..500088a1f3 100644 --- a/packages/babel-generator/test/fixtures/types/ClassExpression/output.js +++ b/packages/babel-generator/test/fixtures/types/ClassExpression/output.js @@ -1,3 +1,3 @@ class Foo {} -class Foo extends Bar {} \ No newline at end of file +class Foo2 extends Bar {} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/types/Decorator/input.js b/packages/babel-generator/test/fixtures/types/Decorator/input.js index f1946c7635..198a50e9c7 100644 --- a/packages/babel-generator/test/fixtures/types/Decorator/input.js +++ b/packages/babel-generator/test/fixtures/types/Decorator/input.js @@ -31,14 +31,14 @@ class Foo { } @foo -export default class Foo { +export default class Foo2 { bar() { class Baz {} } } @foo -export class Foo { +export class Foo3 { bar() { class Baz {} } diff --git a/packages/babel-generator/test/fixtures/types/Decorator/output.js b/packages/babel-generator/test/fixtures/types/Decorator/output.js index 5c526f5f61..db5f62ff6b 100644 --- a/packages/babel-generator/test/fixtures/types/Decorator/output.js +++ b/packages/babel-generator/test/fixtures/types/Decorator/output.js @@ -33,14 +33,14 @@ class Foo { } export default @foo -class Foo { +class Foo2 { bar() { class Baz {} } } export @foo -class Foo { +class Foo3 { bar() { class Baz {} } diff --git a/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/input.js b/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/input.js index 3b31e93eb7..c42d876ad7 100644 --- a/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/input.js +++ b/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/input.js @@ -1,23 +1,23 @@ -function foo(bar = "bar") {} +function foo1(bar = "bar") {} -function foo(bar = "bar", ...items) {} +function foo2(bar = "bar", ...items) {} -function foo(...items) {} +function foo3(...items) {} -function* foo() {} +function* foo4() {} -function foo() {} +function foo5() {} -async function foo() {} +async function foo6() {} -var foo = function* foo() {}; +var foo7 = function* foo7() {}; -var foo = function foo() {}; +var foo8 = function foo8() {}; -var foo = async function foo() {}; +var foo9 = async function foo9() {}; -var foo = function* () {}; +var foo10 = function* () {}; -var foo = function () {}; +var foo11 = function () {}; -var foo = async function () {}; +var foo12 = async function () {}; diff --git a/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/output.js b/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/output.js index ef42e4b2fb..2c28412532 100644 --- a/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/output.js +++ b/packages/babel-generator/test/fixtures/types/FunctionDeclaration-FunctionExpression/output.js @@ -1,23 +1,23 @@ -function foo(bar = "bar") {} +function foo1(bar = "bar") {} -function foo(bar = "bar", ...items) {} +function foo2(bar = "bar", ...items) {} -function foo(...items) {} +function foo3(...items) {} -function* foo() {} +function* foo4() {} -function foo() {} +function foo5() {} -async function foo() {} +async function foo6() {} -var foo = function* foo() {}; +var foo7 = function* foo7() {}; -var foo = function foo() {}; +var foo8 = function foo8() {}; -var foo = async function foo() {}; +var foo9 = async function foo9() {}; -var foo = function* () {}; +var foo10 = function* () {}; -var foo = function () {}; +var foo11 = function () {}; -var foo = async function () {}; \ No newline at end of file +var foo12 = async function () {}; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/input.js b/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/input.js index b7a4a4b9fd..84e2db5be0 100644 --- a/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/input.js +++ b/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/input.js @@ -1,9 +1,9 @@ import "foo"; -import foo from "foo"; -import { default as foo } from "foo"; -import * as foo from "foo"; -import foo, { baz as xyz } from "foo"; -import { bar } from "foo"; -import { bar, baz } from "foo"; -import { bar as baz } from "foo"; -import { bar as baz, xyz } from "foo"; +import foo1 from "foo"; +import { default as foo2 } from "foo"; +import * as foo3 from "foo"; +import foo4, { baz as xyz1 } from "foo"; +import { bar1 } from "foo"; +import { bar2, baz1 } from "foo"; +import { bar as baz2 } from "foo"; +import { bar as baz3, xyz2 } from "foo"; diff --git a/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/output.js b/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/output.js index 7cd5b681f8..c460e5b962 100644 --- a/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/output.js +++ b/packages/babel-generator/test/fixtures/types/ImportDeclaration-ImportSpecifier-ImportNamespaceSpecifier/output.js @@ -1,9 +1,9 @@ import "foo"; -import foo from "foo"; -import { default as foo } from "foo"; -import * as foo from "foo"; -import foo, { baz as xyz } from "foo"; -import { bar } from "foo"; -import { bar, baz } from "foo"; -import { bar as baz } from "foo"; -import { bar as baz, xyz } from "foo"; \ No newline at end of file +import foo1 from "foo"; +import { default as foo2 } from "foo"; +import * as foo3 from "foo"; +import foo4, { baz as xyz1 } from "foo"; +import { bar1 } from "foo"; +import { bar2, baz1 } from "foo"; +import { bar as baz2 } from "foo"; +import { bar as baz3, xyz2 } from "foo"; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/types/ReturnStatement/input.js b/packages/babel-generator/test/fixtures/types/ReturnStatement/input.js index cadd080008..793ca5c4ba 100644 --- a/packages/babel-generator/test/fixtures/types/ReturnStatement/input.js +++ b/packages/babel-generator/test/fixtures/types/ReturnStatement/input.js @@ -1,4 +1,4 @@ -function foo() { +function foo1() { return; } @@ -6,10 +6,10 @@ function bar() { return "foo"; } -function foo() { +function foo2() { return 1, "foo"; } () => { return /a/; } -function foo() { return /a/; } +function foo3() { return /a/; } diff --git a/packages/babel-generator/test/fixtures/types/ReturnStatement/output.js b/packages/babel-generator/test/fixtures/types/ReturnStatement/output.js index e9aa8d3401..5fb776fc76 100644 --- a/packages/babel-generator/test/fixtures/types/ReturnStatement/output.js +++ b/packages/babel-generator/test/fixtures/types/ReturnStatement/output.js @@ -1,4 +1,4 @@ -function foo() { +function foo1() { return; } @@ -6,7 +6,7 @@ function bar() { return "foo"; } -function foo() { +function foo2() { return 1, "foo"; } @@ -14,6 +14,6 @@ function foo() { return /a/; }; -function foo() { +function foo3() { return /a/; } \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/input.js b/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/input.js index ede42c53ec..ae204a4df5 100644 --- a/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/input.js +++ b/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/input.js @@ -1,13 +1,13 @@ -let foo; -var foo; +let foo1; +var foo2; -let foo = "foo"; -var foo = "bar"; -const foo = "foo"; +let foo3 = "foo"; +var foo4 = "bar"; +const foo5 = "foo"; -let foo, bar = "bar"; -var foo, bar = "bar"; +let foo6, bar1 = "bar"; +var foo7, bar2 = "bar"; -let foo = "foo", bar = "bar"; -var foo = "foo", bar = "bar"; -const foo = "foo", bar = "bar"; +let foo8 = "foo", bar3 = "bar"; +var foo9 = "foo", bar4 = "bar"; +const foo10 = "foo", bar5 = "bar"; diff --git a/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/output.js b/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/output.js index c3e42e0913..60453ccb02 100644 --- a/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/output.js +++ b/packages/babel-generator/test/fixtures/types/VariableDeclaration-VariableDeclarator/output.js @@ -1,15 +1,15 @@ -let foo; -var foo; -let foo = "foo"; -var foo = "bar"; -const foo = "foo"; -let foo, - bar = "bar"; -var foo, - bar = "bar"; -let foo = "foo", - bar = "bar"; -var foo = "foo", - bar = "bar"; -const foo = "foo", - bar = "bar"; \ No newline at end of file +let foo1; +var foo2; +let foo3 = "foo"; +var foo4 = "bar"; +const foo5 = "foo"; +let foo6, + bar1 = "bar"; +var foo7, + bar2 = "bar"; +let foo8 = "foo", + bar3 = "bar"; +var foo9 = "foo", + bar4 = "bar"; +const foo10 = "foo", + bar5 = "bar"; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/class-abstract/input.js b/packages/babel-generator/test/fixtures/typescript/class-abstract/input.js index 8f41a8b71f..3cb560c5a3 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-abstract/input.js +++ b/packages/babel-generator/test/fixtures/typescript/class-abstract/input.js @@ -1,7 +1,7 @@ -abstract class C {} -declare abstract class C {} -export abstract class C {} +abstract class C1 {} +declare abstract class C2 {} +export abstract class C3 {} // `export abstract class { }` is not valid. export default abstract class { } -export default abstract class C { } +export default abstract class C4 { } // `abstract class` is not valid as an expression. diff --git a/packages/babel-generator/test/fixtures/typescript/class-abstract/output.js b/packages/babel-generator/test/fixtures/typescript/class-abstract/output.js index 860e03a34d..e621d56e2e 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-abstract/output.js +++ b/packages/babel-generator/test/fixtures/typescript/class-abstract/output.js @@ -1,8 +1,8 @@ -abstract class C {} +abstract class C1 {} -declare abstract class C {} +declare abstract class C2 {} -export abstract class C {} // `export abstract class { }` is not valid. +export abstract class C3 {} // `export abstract class { }` is not valid. export default abstract class {} -export default abstract class C {} // `abstract class` is not valid as an expression. \ No newline at end of file +export default abstract class C4 {} // `abstract class` is not valid as an expression. \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/input.js b/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/input.js index d2cea8ee69..d047bcfa59 100644 --- a/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/input.js +++ b/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/input.js @@ -1,2 +1,2 @@ let x: true; -let x: false; +let x2: false; diff --git a/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/output.js b/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/output.js index 2a25bd9d18..dbec899ee6 100644 --- a/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/output.js +++ b/packages/babel-generator/test/fixtures/typescript/types-literal-boolean/output.js @@ -1,2 +1,2 @@ let x: true; -let x: false; \ No newline at end of file +let x2: false; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/types-mapped/input.js b/packages/babel-generator/test/fixtures/typescript/types-mapped/input.js index 575af654a4..6415810f05 100644 --- a/packages/babel-generator/test/fixtures/typescript/types-mapped/input.js +++ b/packages/babel-generator/test/fixtures/typescript/types-mapped/input.js @@ -1,4 +1,4 @@ -let map: { [P in string]: number }; -let map: { readonly [P in string]?: number }; -let map: { +readonly [P in string]+?: number }; -let map: { -readonly [P in string]-?: number }; +let map1: { [P in string]: number }; +let map2: { readonly [P in string]?: number }; +let map3: { +readonly [P in string]+?: number }; +let map4: { -readonly [P in string]-?: number }; diff --git a/packages/babel-generator/test/fixtures/typescript/types-mapped/output.js b/packages/babel-generator/test/fixtures/typescript/types-mapped/output.js index bb0a678636..208e77ca40 100644 --- a/packages/babel-generator/test/fixtures/typescript/types-mapped/output.js +++ b/packages/babel-generator/test/fixtures/typescript/types-mapped/output.js @@ -1,4 +1,4 @@ -let map: { [P in string]: number }; -let map: { readonly [P in string]?: number }; -let map: { +readonly [P in string]+?: number }; -let map: { -readonly [P in string]-?: number }; \ No newline at end of file +let map1: { [P in string]: number }; +let map2: { readonly [P in string]?: number }; +let map3: { +readonly [P in string]+?: number }; +let map4: { -readonly [P in string]-?: number }; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/input.js deleted file mode 100644 index 6cafc79275..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/input.js +++ /dev/null @@ -1 +0,0 @@ -function null() { } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json deleted file mode 100644 index 2a28555f76..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0108/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/input.js deleted file mode 100644 index bc1d04c212..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/input.js +++ /dev/null @@ -1 +0,0 @@ -function true() { } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json deleted file mode 100644 index 2a28555f76..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0109/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/input.js deleted file mode 100644 index 4480e07b7d..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/input.js +++ /dev/null @@ -1 +0,0 @@ -function false() { } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json deleted file mode 100644 index 2a28555f76..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0110/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/input.js deleted file mode 100644 index df1aa5f561..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/input.js +++ /dev/null @@ -1 +0,0 @@ -function if() { } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json deleted file mode 100644 index 2a28555f76..0000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0111/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js index 2e57778bbb..91a95beaa1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js @@ -3,7 +3,7 @@ class Foo { y } -class Foo { +class Foo2 { p [m] () {} } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json index 6f798008cb..1b75f5865d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 52, + "end": 53, "loc": { "start": { "line": 1, @@ -15,7 +15,7 @@ "program": { "type": "Program", "start": 0, - "end": 52, + "end": 53, "loc": { "start": { "line": 1, @@ -152,7 +152,7 @@ { "type": "ClassDeclaration", "start": 23, - "end": 52, + "end": 53, "loc": { "start": { "line": 6, @@ -166,7 +166,7 @@ "id": { "type": "Identifier", "start": 29, - "end": 32, + "end": 33, "loc": { "start": { "line": 6, @@ -174,21 +174,21 @@ }, "end": { "line": 6, - "column": 9 + "column": 10 }, - "identifierName": "Foo" + "identifierName": "Foo2" }, - "name": "Foo" + "name": "Foo2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 33, - "end": 52, + "start": 34, + "end": 53, "loc": { "start": { "line": 6, - "column": 10 + "column": 11 }, "end": { "line": 9, @@ -198,8 +198,8 @@ "body": [ { "type": "ClassProperty", - "start": 37, - "end": 38, + "start": 38, + "end": 39, "loc": { "start": { "line": 7, @@ -213,8 +213,8 @@ "static": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, + "start": 38, + "end": 39, "loc": { "start": { "line": 7, @@ -233,8 +233,8 @@ }, { "type": "ClassMethod", - "start": 41, - "end": 50, + "start": 42, + "end": 51, "loc": { "start": { "line": 8, @@ -249,8 +249,8 @@ "computed": true, "key": { "type": "Identifier", - "start": 42, - "end": 43, + "start": 43, + "end": 44, "loc": { "start": { "line": 8, @@ -271,8 +271,8 @@ "params": [], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, + "start": 49, + "end": 51, "loc": { "start": { "line": 8, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js index d3bc5e5d6f..a712d16ba6 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js @@ -3,7 +3,7 @@ class Foo { ['y'] } -class Foo { +class Foo2 { [p] [m] () {} } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json index 4b12933c42..40771337a3 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 60, + "end": 61, "loc": { "start": { "line": 1, @@ -15,7 +15,7 @@ "program": { "type": "Program", "start": 0, - "end": 60, + "end": 61, "loc": { "start": { "line": 1, @@ -155,7 +155,7 @@ { "type": "ClassDeclaration", "start": 29, - "end": 60, + "end": 61, "loc": { "start": { "line": 6, @@ -169,7 +169,7 @@ "id": { "type": "Identifier", "start": 35, - "end": 38, + "end": 39, "loc": { "start": { "line": 6, @@ -177,21 +177,21 @@ }, "end": { "line": 6, - "column": 9 + "column": 10 }, - "identifierName": "Foo" + "identifierName": "Foo2" }, - "name": "Foo" + "name": "Foo2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 39, - "end": 60, + "start": 40, + "end": 61, "loc": { "start": { "line": 6, - "column": 10 + "column": 11 }, "end": { "line": 9, @@ -201,8 +201,8 @@ "body": [ { "type": "ClassProperty", - "start": 43, - "end": 46, + "start": 44, + "end": 47, "loc": { "start": { "line": 7, @@ -217,8 +217,8 @@ "computed": true, "key": { "type": "Identifier", - "start": 44, - "end": 45, + "start": 45, + "end": 46, "loc": { "start": { "line": 7, @@ -236,8 +236,8 @@ }, { "type": "ClassMethod", - "start": 49, - "end": 58, + "start": 50, + "end": 59, "loc": { "start": { "line": 8, @@ -252,8 +252,8 @@ "computed": true, "key": { "type": "Identifier", - "start": 50, - "end": 51, + "start": 51, + "end": 52, "loc": { "start": { "line": 8, @@ -274,8 +274,8 @@ "params": [], "body": { "type": "BlockStatement", - "start": 56, - "end": 58, + "start": 57, + "end": 59, "loc": { "start": { "line": 8, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js index 6cc3a4087c..bcbcd17cdb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js @@ -1,3 +1,3 @@ -class A { +class A extends B { foo = () => super.x(); } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json index bf0e39a950..d411c6ff6e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 36, + "end": 46, "loc": { "start": { "line": 1, @@ -15,7 +15,7 @@ "program": { "type": "Program", "start": 0, - "end": 36, + "end": 46, "loc": { "start": { "line": 1, @@ -32,7 +32,7 @@ { "type": "ClassDeclaration", "start": 0, - "end": 36, + "end": 46, "loc": { "start": { "line": 1, @@ -60,15 +60,31 @@ }, "name": "A" }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 8, - "end": 36, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, "loc": { "start": { "line": 1, - "column": 8 + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 18 }, "end": { "line": 3, @@ -78,8 +94,8 @@ "body": [ { "type": "ClassProperty", - "start": 12, - "end": 34, + "start": 22, + "end": 44, "loc": { "start": { "line": 2, @@ -93,8 +109,8 @@ "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, + "start": 22, + "end": 25, "loc": { "start": { "line": 2, @@ -111,8 +127,8 @@ "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 18, - "end": 33, + "start": 28, + "end": 43, "loc": { "start": { "line": 2, @@ -129,8 +145,8 @@ "params": [], "body": { "type": "CallExpression", - "start": 24, - "end": 33, + "start": 34, + "end": 43, "loc": { "start": { "line": 2, @@ -143,8 +159,8 @@ }, "callee": { "type": "MemberExpression", - "start": 24, - "end": 31, + "start": 34, + "end": 41, "loc": { "start": { "line": 2, @@ -157,8 +173,8 @@ }, "object": { "type": "Super", - "start": 24, - "end": 29, + "start": 34, + "end": 39, "loc": { "start": { "line": 2, @@ -172,8 +188,8 @@ }, "property": { "type": "Identifier", - "start": 30, - "end": 31, + "start": 40, + "end": 41, "loc": { "start": { "line": 2, diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js b/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js index 31dcb716ca..c3fc230296 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js @@ -1,5 +1,5 @@ -class A{ +class A extends B { constructor(){ super()?.b; } -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json index 877e7f493a..890c6f2248 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 55, + "end": 66, "loc": { "start": { "line": 1, @@ -15,7 +15,7 @@ "program": { "type": "Program", "start": 0, - "end": 55, + "end": 66, "loc": { "start": { "line": 1, @@ -32,7 +32,7 @@ { "type": "ClassDeclaration", "start": 0, - "end": 55, + "end": 66, "loc": { "start": { "line": 1, @@ -60,15 +60,31 @@ }, "name": "A" }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 7, - "end": 55, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, "loc": { "start": { "line": 1, - "column": 7 + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 18 }, "end": { "line": 5, @@ -78,8 +94,8 @@ "body": [ { "type": "ClassMethod", - "start": 13, - "end": 53, + "start": 24, + "end": 64, "loc": { "start": { "line": 2, @@ -93,8 +109,8 @@ "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 24, + "start": 24, + "end": 35, "loc": { "start": { "line": 2, @@ -116,8 +132,8 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 53, + "start": 37, + "end": 64, "loc": { "start": { "line": 2, @@ -131,8 +147,8 @@ "body": [ { "type": "ExpressionStatement", - "start": 36, - "end": 47, + "start": 47, + "end": 58, "loc": { "start": { "line": 3, @@ -145,8 +161,8 @@ }, "expression": { "type": "OptionalMemberExpression", - "start": 36, - "end": 46, + "start": 47, + "end": 57, "loc": { "start": { "line": 3, @@ -159,8 +175,8 @@ }, "object": { "type": "CallExpression", - "start": 36, - "end": 43, + "start": 47, + "end": 54, "loc": { "start": { "line": 3, @@ -173,8 +189,8 @@ }, "callee": { "type": "Super", - "start": 36, - "end": 41, + "start": 47, + "end": 52, "loc": { "start": { "line": 3, @@ -190,8 +206,8 @@ }, "property": { "type": "Identifier", - "start": 45, - "end": 46, + "start": 56, + "end": 57, "loc": { "start": { "line": 3, diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-321/input.js b/packages/babel-parser/test/fixtures/flow/regression/issue-321/input.js index c4d6e74d84..42132cbb00 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-321/input.js +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-321/input.js @@ -1,2 +1,2 @@ const fn: ( Object, ?Object ) => void = ( o1, o2 ) => o1; -const fn: ( Object, ?Object, ) => void = ( o1, o2, ) => o1; +const fn2: ( Object, ?Object, ) => void = ( o1, o2, ) => o1; diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json index 8d458c08f4..1af4cfcdc0 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 117, + "end": 118, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 2, - "column": 59 + "column": 60 } }, "program": { "type": "Program", "start": 0, - "end": 117, + "end": 118, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 2, - "column": 59 + "column": 60 } }, "sourceType": "module", @@ -317,7 +317,7 @@ { "type": "VariableDeclaration", "start": 58, - "end": 117, + "end": 118, "loc": { "start": { "line": 2, @@ -325,14 +325,14 @@ }, "end": { "line": 2, - "column": 59 + "column": 60 } }, "declarations": [ { "type": "VariableDeclarator", "start": 64, - "end": 116, + "end": 117, "loc": { "start": { "line": 2, @@ -340,13 +340,13 @@ }, "end": { "line": 2, - "column": 58 + "column": 59 } }, "id": { "type": "Identifier", "start": 64, - "end": 96, + "end": 97, "loc": { "start": { "line": 2, @@ -354,83 +354,83 @@ }, "end": { "line": 2, - "column": 38 + "column": 39 }, - "identifierName": "fn" + "identifierName": "fn2" }, - "name": "fn", + "name": "fn2", "typeAnnotation": { "type": "TypeAnnotation", - "start": 66, - "end": 96, + "start": 67, + "end": 97, "loc": { "start": { "line": 2, - "column": 8 + "column": 9 }, "end": { "line": 2, - "column": 38 + "column": 39 } }, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 68, - "end": 96, + "start": 69, + "end": 97, "loc": { "start": { "line": 2, - "column": 10 + "column": 11 }, "end": { "line": 2, - "column": 38 + "column": 39 } }, "params": [ { "type": "FunctionTypeParam", - "start": 70, - "end": 77, + "start": 71, + "end": 78, "loc": { "start": { "line": 2, - "column": 12 + "column": 13 }, "end": { "line": 2, - "column": 19 + "column": 20 } }, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 70, - "end": 76, + "start": 71, + "end": 77, "loc": { "start": { "line": 2, - "column": 12 + "column": 13 }, "end": { "line": 2, - "column": 18 + "column": 19 } }, "typeParameters": null, "id": { "type": "Identifier", - "start": 70, - "end": 76, + "start": 71, + "end": 77, "loc": { "start": { "line": 2, - "column": 12 + "column": 13 }, "end": { "line": 2, - "column": 18 + "column": 19 }, "identifierName": "Object" }, @@ -440,61 +440,61 @@ }, { "type": "FunctionTypeParam", - "start": 78, - "end": 85, + "start": 79, + "end": 86, "loc": { "start": { "line": 2, - "column": 20 + "column": 21 }, "end": { "line": 2, - "column": 27 + "column": 28 } }, "name": null, "optional": false, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 78, - "end": 85, + "start": 79, + "end": 86, "loc": { "start": { "line": 2, - "column": 20 + "column": 21 }, "end": { "line": 2, - "column": 27 + "column": 28 } }, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 79, - "end": 85, + "start": 80, + "end": 86, "loc": { "start": { "line": 2, - "column": 21 + "column": 22 }, "end": { "line": 2, - "column": 27 + "column": 28 } }, "typeParameters": null, "id": { "type": "Identifier", - "start": 79, - "end": 85, + "start": 80, + "end": 86, "loc": { "start": { "line": 2, - "column": 21 + "column": 22 }, "end": { "line": 2, - "column": 27 + "column": 28 }, "identifierName": "Object" }, @@ -507,16 +507,16 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 92, - "end": 96, + "start": 93, + "end": 97, "loc": { "start": { "line": 2, - "column": 34 + "column": 35 }, "end": { "line": 2, - "column": 38 + "column": 39 } } }, @@ -526,16 +526,16 @@ }, "init": { "type": "ArrowFunctionExpression", - "start": 99, - "end": 116, + "start": 100, + "end": 117, "loc": { "start": { "line": 2, - "column": 41 + "column": 42 }, "end": { "line": 2, - "column": 58 + "column": 59 } }, "id": null, @@ -544,16 +544,16 @@ "params": [ { "type": "Identifier", - "start": 101, - "end": 103, + "start": 102, + "end": 104, "loc": { "start": { "line": 2, - "column": 43 + "column": 44 }, "end": { "line": 2, - "column": 45 + "column": 46 }, "identifierName": "o1" }, @@ -561,16 +561,16 @@ }, { "type": "Identifier", - "start": 105, - "end": 107, + "start": 106, + "end": 108, "loc": { "start": { "line": 2, - "column": 47 + "column": 48 }, "end": { "line": 2, - "column": 49 + "column": 50 }, "identifierName": "o2" }, @@ -579,16 +579,16 @@ ], "body": { "type": "Identifier", - "start": 114, - "end": 116, + "start": 115, + "end": 117, "loc": { "start": { "line": 2, - "column": 56 + "column": 57 }, "end": { "line": 2, - "column": 58 + "column": 59 }, "identifierName": "o1" }, diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/input.js b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/input.js new file mode 100644 index 0000000000..34f185e05f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/input.js @@ -0,0 +1 @@ +import type, { foo } from "bar"; diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json new file mode 100644 index 0000000000..f5fc078a42 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json @@ -0,0 +1,155 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "type" + }, + "name": "type" + } + }, + { + "type": "ImportSpecifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "imported": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": "bar", + "raw": "\"bar\"" + }, + "value": "bar" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/input.js b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/input.js index 43d6942549..8dcd1106d5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/input.js +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/input.js @@ -5,7 +5,7 @@ import {type as as foo} from "foo"; import {type t as u} from "foo"; import {type switch} from "foo"; -import {typeof t} from "foo"; -import {typeof as} from "foo"; -import {typeof t as u} from "foo"; -import {typeof switch} from "foo"; +import {typeof t2} from "foo"; +import {typeof as2} from "foo"; +import {typeof t as u2} from "foo"; +import {typeof switch2} from "foo"; diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json index f464931404..aeb7eded07 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 316, + "end": 320, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 11, - "column": 34 + "column": 35 } }, "program": { "type": "Program", "start": 0, - "end": 316, + "end": 320, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 11, - "column": 34 + "column": 35 } }, "sourceType": "module", @@ -560,7 +560,7 @@ { "type": "ImportDeclaration", "start": 186, - "end": 215, + "end": 216, "loc": { "start": { "line": 8, @@ -568,161 +568,73 @@ }, "end": { "line": 8, - "column": 29 - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "start": 194, - "end": 202, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 16 - } - }, - "imported": { - "type": "Identifier", - "start": 201, - "end": 202, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 16 - }, - "identifierName": "t" - }, - "name": "t" - }, - "importKind": "typeof", - "local": { - "type": "Identifier", - "start": 201, - "end": 202, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 16 - }, - "identifierName": "t" - }, - "name": "t" - } - } - ], - "importKind": "value", - "source": { - "type": "StringLiteral", - "start": 209, - "end": 214, - "loc": { - "start": { - "line": 8, - "column": 23 - }, - "end": { - "line": 8, - "column": 28 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 216, - "end": 246, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, "column": 30 } }, "specifiers": [ { "type": "ImportSpecifier", - "start": 224, - "end": 233, + "start": 194, + "end": 203, "loc": { "start": { - "line": 9, + "line": 8, "column": 8 }, "end": { - "line": 9, + "line": 8, "column": 17 } }, "imported": { "type": "Identifier", - "start": 231, - "end": 233, + "start": 201, + "end": 203, "loc": { "start": { - "line": 9, + "line": 8, "column": 15 }, "end": { - "line": 9, + "line": 8, "column": 17 }, - "identifierName": "as" + "identifierName": "t2" }, - "name": "as" + "name": "t2" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 231, - "end": 233, + "start": 201, + "end": 203, "loc": { "start": { - "line": 9, + "line": 8, "column": 15 }, "end": { - "line": 9, + "line": 8, "column": 17 }, - "identifierName": "as" + "identifierName": "t2" }, - "name": "as" + "name": "t2" } } ], "importKind": "value", "source": { "type": "StringLiteral", - "start": 240, - "end": 245, + "start": 210, + "end": 215, "loc": { "start": { - "line": 9, + "line": 8, "column": 24 }, "end": { - "line": 9, + "line": 8, "column": 29 } }, @@ -735,8 +647,96 @@ }, { "type": "ImportDeclaration", - "start": 247, - "end": 281, + "start": 217, + "end": 248, + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 225, + "end": 235, + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "imported": { + "type": "Identifier", + "start": 232, + "end": 235, + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + }, + "identifierName": "as2" + }, + "name": "as2" + }, + "importKind": "typeof", + "local": { + "type": "Identifier", + "start": 232, + "end": 235, + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + }, + "identifierName": "as2" + }, + "name": "as2" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 242, + "end": 247, + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + }, + { + "type": "ImportDeclaration", + "start": 249, + "end": 284, "loc": { "start": { "line": 10, @@ -744,14 +744,14 @@ }, "end": { "line": 10, - "column": 34 + "column": 35 } }, "specifiers": [ { "type": "ImportSpecifier", - "start": 255, - "end": 268, + "start": 257, + "end": 271, "loc": { "start": { "line": 10, @@ -759,13 +759,13 @@ }, "end": { "line": 10, - "column": 21 + "column": 22 } }, "imported": { "type": "Identifier", - "start": 262, - "end": 263, + "start": 264, + "end": 265, "loc": { "start": { "line": 10, @@ -782,8 +782,8 @@ "importKind": "typeof", "local": { "type": "Identifier", - "start": 267, - "end": 268, + "start": 269, + "end": 271, "loc": { "start": { "line": 10, @@ -791,27 +791,27 @@ }, "end": { "line": 10, - "column": 21 + "column": 22 }, - "identifierName": "u" + "identifierName": "u2" }, - "name": "u" + "name": "u2" } } ], "importKind": "value", "source": { "type": "StringLiteral", - "start": 275, - "end": 280, + "start": 278, + "end": 283, "loc": { "start": { "line": 10, - "column": 28 + "column": 29 }, "end": { "line": 10, - "column": 33 + "column": 34 } }, "extra": { @@ -823,8 +823,8 @@ }, { "type": "ImportDeclaration", - "start": 282, - "end": 316, + "start": 285, + "end": 320, "loc": { "start": { "line": 11, @@ -832,14 +832,14 @@ }, "end": { "line": 11, - "column": 34 + "column": 35 } }, "specifiers": [ { "type": "ImportSpecifier", - "start": 290, - "end": 303, + "start": 293, + "end": 307, "loc": { "start": { "line": 11, @@ -847,13 +847,13 @@ }, "end": { "line": 11, - "column": 21 + "column": 22 } }, "imported": { "type": "Identifier", - "start": 297, - "end": 303, + "start": 300, + "end": 307, "loc": { "start": { "line": 11, @@ -861,17 +861,17 @@ }, "end": { "line": 11, - "column": 21 + "column": 22 }, - "identifierName": "switch" + "identifierName": "switch2" }, - "name": "switch" + "name": "switch2" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 297, - "end": 303, + "start": 300, + "end": 307, "loc": { "start": { "line": 11, @@ -879,27 +879,27 @@ }, "end": { "line": 11, - "column": 21 + "column": 22 }, - "identifierName": "switch" + "identifierName": "switch2" }, - "name": "switch" + "name": "switch2" } } ], "importKind": "value", "source": { "type": "StringLiteral", - "start": 310, - "end": 315, + "start": 314, + "end": 319, "loc": { "start": { "line": 11, - "column": 28 + "column": 29 }, "end": { "line": 11, - "column": 33 + "column": 34 } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/input.js b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/input.js index 70d71926f9..c2a9d4360f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/input.js +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/input.js @@ -1,14 +1,13 @@ -import type Def from "foo"; -import type {named} from "foo"; -import type Def, {named} from "foo"; -import type switch from "foo"; -import type { switch } from "foo"; -import type { foo, bar } from "baz"; +import type Def1 from "foo"; +import type {named1} from "foo"; +import type Def2, {named2} from "foo"; +import type switch1 from "foo"; +import type { switch2 } from "foo"; +import type { foo1, bar1 } from "baz"; import type from "foo"; -import type, { foo } from "bar"; -import typeof foo from "bar"; -import typeof switch from "foo"; -import typeof { switch } from "foo"; -import typeof { foo as bar } from "baz"; -import typeof * as ns from "foo"; -import typeof * as switch from "foo"; +import typeof foo3 from "bar"; +import typeof switch4 from "foo"; +import typeof { switch5 } from "foo"; +import typeof { foo as bar6 } from "baz"; +import typeof * as ns7 from "foo"; +import typeof * as switch8 from "foo"; diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json index 904bcfab26..8e626c8ad0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json @@ -1,29 +1,29 @@ { "type": "File", "start": 0, - "end": 469, + "end": 450, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 14, - "column": 37 + "line": 13, + "column": 38 } }, "program": { "type": "Program", "start": 0, - "end": 469, + "end": 450, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 14, - "column": 37 + "line": 13, + "column": 38 } }, "sourceType": "module", @@ -32,7 +32,7 @@ { "type": "ImportDeclaration", "start": 0, - "end": 27, + "end": 28, "loc": { "start": { "line": 1, @@ -40,14 +40,14 @@ }, "end": { "line": 1, - "column": 27 + "column": 28 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 12, - "end": 15, + "end": 16, "loc": { "start": { "line": 1, @@ -55,13 +55,13 @@ }, "end": { "line": 1, - "column": 15 + "column": 16 } }, "local": { "type": "Identifier", "start": 12, - "end": 15, + "end": 16, "loc": { "start": { "line": 1, @@ -69,27 +69,27 @@ }, "end": { "line": 1, - "column": 15 + "column": 16 }, - "identifierName": "Def" + "identifierName": "Def1" }, - "name": "Def" + "name": "Def1" } } ], "importKind": "type", "source": { "type": "StringLiteral", - "start": 21, - "end": 26, + "start": 22, + "end": 27, "loc": { "start": { "line": 1, - "column": 21 + "column": 22 }, "end": { "line": 1, - "column": 26 + "column": 27 } }, "extra": { @@ -101,8 +101,8 @@ }, { "type": "ImportDeclaration", - "start": 28, - "end": 59, + "start": 29, + "end": 61, "loc": { "start": { "line": 2, @@ -110,14 +110,14 @@ }, "end": { "line": 2, - "column": 31 + "column": 32 } }, "specifiers": [ { "type": "ImportSpecifier", - "start": 41, - "end": 46, + "start": 42, + "end": 48, "loc": { "start": { "line": 2, @@ -125,13 +125,13 @@ }, "end": { "line": 2, - "column": 18 + "column": 19 } }, "imported": { "type": "Identifier", - "start": 41, - "end": 46, + "start": 42, + "end": 48, "loc": { "start": { "line": 2, @@ -139,17 +139,17 @@ }, "end": { "line": 2, - "column": 18 + "column": 19 }, - "identifierName": "named" + "identifierName": "named1" }, - "name": "named" + "name": "named1" }, "importKind": null, "local": { "type": "Identifier", - "start": 41, - "end": 46, + "start": 42, + "end": 48, "loc": { "start": { "line": 2, @@ -157,27 +157,27 @@ }, "end": { "line": 2, - "column": 18 + "column": 19 }, - "identifierName": "named" + "identifierName": "named1" }, - "name": "named" + "name": "named1" } } ], "importKind": "type", "source": { "type": "StringLiteral", - "start": 53, - "end": 58, + "start": 55, + "end": 60, "loc": { "start": { "line": 2, - "column": 25 + "column": 26 }, "end": { "line": 2, - "column": 30 + "column": 31 } }, "extra": { @@ -189,8 +189,8 @@ }, { "type": "ImportDeclaration", - "start": 60, - "end": 96, + "start": 62, + "end": 100, "loc": { "start": { "line": 3, @@ -198,14 +198,14 @@ }, "end": { "line": 3, - "column": 36 + "column": 38 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 72, - "end": 75, + "start": 74, + "end": 78, "loc": { "start": { "line": 3, @@ -213,13 +213,13 @@ }, "end": { "line": 3, - "column": 15 + "column": 16 } }, "local": { "type": "Identifier", - "start": 72, - "end": 75, + "start": 74, + "end": 78, "loc": { "start": { "line": 3, @@ -227,373 +227,373 @@ }, "end": { "line": 3, - "column": 15 + "column": 16 }, - "identifierName": "Def" + "identifierName": "Def2" }, - "name": "Def" + "name": "Def2" } }, { "type": "ImportSpecifier", - "start": 78, - "end": 83, + "start": 81, + "end": 87, "loc": { "start": { "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - } - }, - "imported": { - "type": "Identifier", - "start": 78, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "named" - }, - "name": "named" - }, - "importKind": null, - "local": { - "type": "Identifier", - "start": 78, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "named" - }, - "name": "named" - } - } - ], - "importKind": "type", - "source": { - "type": "StringLiteral", - "start": 90, - "end": 95, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 35 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 97, - "end": 127, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "start": 109, - "end": 115, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 18 - } - }, - "local": { - "type": "Identifier", - "start": 109, - "end": 115, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "switch" - }, - "name": "switch" - } - } - ], - "importKind": "type", - "source": { - "type": "StringLiteral", - "start": 121, - "end": 126, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 29 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 128, - "end": 162, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "start": 142, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 20 - } - }, - "imported": { - "type": "Identifier", - "start": 142, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "switch" - }, - "name": "switch" - }, - "importKind": null, - "local": { - "type": "Identifier", - "start": 142, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "switch" - }, - "name": "switch" - } - } - ], - "importKind": "type", - "source": { - "type": "StringLiteral", - "start": 156, - "end": 161, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 5, - "column": 33 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 163, - "end": 199, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 36 - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "start": 177, - "end": 180, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 17 - } - }, - "imported": { - "type": "Identifier", - "start": 177, - "end": 180, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 17 - }, - "identifierName": "foo" - }, - "name": "foo" - }, - "importKind": null, - "local": { - "type": "Identifier", - "start": 177, - "end": 180, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 17 - }, - "identifierName": "foo" - }, - "name": "foo" - } - }, - { - "type": "ImportSpecifier", - "start": 182, - "end": 185, - "loc": { - "start": { - "line": 6, "column": 19 }, "end": { - "line": 6, - "column": 22 + "line": 3, + "column": 25 } }, "imported": { "type": "Identifier", - "start": 182, - "end": 185, + "start": 81, + "end": 87, "loc": { "start": { - "line": 6, + "line": 3, "column": 19 }, "end": { - "line": 6, - "column": 22 + "line": 3, + "column": 25 }, - "identifierName": "bar" + "identifierName": "named2" }, - "name": "bar" + "name": "named2" }, "importKind": null, "local": { "type": "Identifier", - "start": 182, - "end": 185, + "start": 81, + "end": 87, "loc": { "start": { - "line": 6, + "line": 3, "column": 19 }, "end": { - "line": 6, - "column": 22 + "line": 3, + "column": 25 }, - "identifierName": "bar" + "identifierName": "named2" }, - "name": "bar" + "name": "named2" } } ], "importKind": "type", "source": { "type": "StringLiteral", - "start": 193, - "end": 198, + "start": 94, + "end": 99, + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + }, + { + "type": "ImportDeclaration", + "start": 101, + "end": 132, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 113, + "end": 120, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "local": { + "type": "Identifier", + "start": 113, + "end": 120, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 19 + }, + "identifierName": "switch1" + }, + "name": "switch1" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 126, + "end": 131, + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + }, + { + "type": "ImportDeclaration", + "start": 133, + "end": 168, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 35 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 147, + "end": 154, + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "imported": { + "type": "Identifier", + "start": 147, + "end": 154, + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 21 + }, + "identifierName": "switch2" + }, + "name": "switch2" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 147, + "end": 154, + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 21 + }, + "identifierName": "switch2" + }, + "name": "switch2" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 162, + "end": 167, + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + }, + { + "type": "ImportDeclaration", + "start": 169, + "end": 207, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 183, + "end": 187, + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "imported": { + "type": "Identifier", + "start": 183, + "end": 187, + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 18 + }, + "identifierName": "foo1" + }, + "name": "foo1" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 183, + "end": 187, + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 18 + }, + "identifierName": "foo1" + }, + "name": "foo1" + } + }, + { + "type": "ImportSpecifier", + "start": 189, + "end": 193, + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "imported": { + "type": "Identifier", + "start": 189, + "end": 193, + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 24 + }, + "identifierName": "bar1" + }, + "name": "bar1" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 189, + "end": 193, + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 24 + }, + "identifierName": "bar1" + }, + "name": "bar1" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 201, + "end": 206, "loc": { "start": { "line": 6, - "column": 30 + "column": 32 }, "end": { "line": 6, - "column": 35 + "column": 37 } }, "extra": { @@ -605,8 +605,8 @@ }, { "type": "ImportDeclaration", - "start": 200, - "end": 223, + "start": 208, + "end": 231, "loc": { "start": { "line": 7, @@ -620,8 +620,8 @@ "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 207, - "end": 211, + "start": 215, + "end": 219, "loc": { "start": { "line": 7, @@ -634,8 +634,8 @@ }, "local": { "type": "Identifier", - "start": 207, - "end": 211, + "start": 215, + "end": 219, "loc": { "start": { "line": 7, @@ -654,8 +654,8 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 217, - "end": 222, + "start": 225, + "end": 230, "loc": { "start": { "line": 7, @@ -675,8 +675,8 @@ }, { "type": "ImportDeclaration", - "start": 224, - "end": 256, + "start": 232, + "end": 262, "loc": { "start": { "line": 8, @@ -684,106 +684,56 @@ }, "end": { "line": 8, - "column": 32 + "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 231, - "end": 235, + "start": 246, + "end": 250, "loc": { "start": { "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 11 - } - }, - "local": { - "type": "Identifier", - "start": 231, - "end": 235, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 11 - }, - "identifierName": "type" - }, - "name": "type" - } - }, - { - "type": "ImportSpecifier", - "start": 239, - "end": 242, - "loc": { - "start": { - "line": 8, - "column": 15 + "column": 14 }, "end": { "line": 8, "column": 18 } }, - "imported": { - "type": "Identifier", - "start": 239, - "end": 242, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 18 - }, - "identifierName": "foo" - }, - "name": "foo" - }, - "importKind": null, "local": { "type": "Identifier", - "start": 239, - "end": 242, + "start": 246, + "end": 250, "loc": { "start": { "line": 8, - "column": 15 + "column": 14 }, "end": { "line": 8, "column": 18 }, - "identifierName": "foo" + "identifierName": "foo3" }, - "name": "foo" + "name": "foo3" } } ], - "importKind": "value", + "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 250, - "end": 255, + "start": 256, + "end": 261, "loc": { "start": { "line": 8, - "column": 26 + "column": 24 }, "end": { "line": 8, - "column": 31 + "column": 29 } }, "extra": { @@ -795,8 +745,8 @@ }, { "type": "ImportDeclaration", - "start": 257, - "end": 286, + "start": 263, + "end": 296, "loc": { "start": { "line": 9, @@ -804,371 +754,55 @@ }, "end": { "line": 9, - "column": 29 - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "start": 271, - "end": 274, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 17 - } - }, - "local": { - "type": "Identifier", - "start": 271, - "end": 274, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 17 - }, - "identifierName": "foo" - }, - "name": "foo" - } - } - ], - "importKind": "typeof", - "source": { - "type": "StringLiteral", - "start": 280, - "end": 285, - "loc": { - "start": { - "line": 9, - "column": 23 - }, - "end": { - "line": 9, - "column": 28 - } - }, - "extra": { - "rawValue": "bar", - "raw": "\"bar\"" - }, - "value": "bar" - } - }, - { - "type": "ImportDeclaration", - "start": 287, - "end": 319, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 32 - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "start": 301, - "end": 307, - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 20 - } - }, - "local": { - "type": "Identifier", - "start": 301, - "end": 307, - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 20 - }, - "identifierName": "switch" - }, - "name": "switch" - } - } - ], - "importKind": "typeof", - "source": { - "type": "StringLiteral", - "start": 313, - "end": 318, - "loc": { - "start": { - "line": 10, - "column": 26 - }, - "end": { - "line": 10, - "column": 31 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 320, - "end": 356, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 36 - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "start": 336, - "end": 342, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 22 - } - }, - "imported": { - "type": "Identifier", - "start": 336, - "end": 342, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 22 - }, - "identifierName": "switch" - }, - "name": "switch" - }, - "importKind": null, - "local": { - "type": "Identifier", - "start": 336, - "end": 342, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 22 - }, - "identifierName": "switch" - }, - "name": "switch" - } - } - ], - "importKind": "typeof", - "source": { - "type": "StringLiteral", - "start": 350, - "end": 355, - "loc": { - "start": { - "line": 11, - "column": 30 - }, - "end": { - "line": 11, - "column": 35 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start": 357, - "end": 397, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 40 - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "start": 373, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 26 - } - }, - "imported": { - "type": "Identifier", - "start": 373, - "end": 376, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 19 - }, - "identifierName": "foo" - }, - "name": "foo" - }, - "importKind": null, - "local": { - "type": "Identifier", - "start": 380, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 23 - }, - "end": { - "line": 12, - "column": 26 - }, - "identifierName": "bar" - }, - "name": "bar" - } - } - ], - "importKind": "typeof", - "source": { - "type": "StringLiteral", - "start": 391, - "end": 396, - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 39 - } - }, - "extra": { - "rawValue": "baz", - "raw": "\"baz\"" - }, - "value": "baz" - } - }, - { - "type": "ImportDeclaration", - "start": 398, - "end": 431, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, "column": 33 } }, "specifiers": [ { - "type": "ImportNamespaceSpecifier", - "start": 412, - "end": 419, + "type": "ImportDefaultSpecifier", + "start": 277, + "end": 284, "loc": { "start": { - "line": 13, + "line": 9, "column": 14 }, "end": { - "line": 13, + "line": 9, "column": 21 } }, "local": { "type": "Identifier", - "start": 417, - "end": 419, + "start": 277, + "end": 284, "loc": { "start": { - "line": 13, - "column": 19 + "line": 9, + "column": 14 }, "end": { - "line": 13, + "line": 9, "column": 21 }, - "identifierName": "ns" + "identifierName": "switch4" }, - "name": "ns" + "name": "switch4" } } ], "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 425, - "end": 430, + "start": 290, + "end": 295, "loc": { "start": { - "line": 13, + "line": 9, "column": 27 }, "end": { - "line": 13, + "line": 9, "column": 32 } }, @@ -1181,64 +815,82 @@ }, { "type": "ImportDeclaration", - "start": 432, - "end": 469, + "start": 297, + "end": 334, "loc": { "start": { - "line": 14, + "line": 10, "column": 0 }, "end": { - "line": 14, + "line": 10, "column": 37 } }, "specifiers": [ { - "type": "ImportNamespaceSpecifier", - "start": 446, - "end": 457, + "type": "ImportSpecifier", + "start": 313, + "end": 320, "loc": { "start": { - "line": 14, - "column": 14 + "line": 10, + "column": 16 }, "end": { - "line": 14, - "column": 25 + "line": 10, + "column": 23 } }, - "local": { + "imported": { "type": "Identifier", - "start": 451, - "end": 457, + "start": 313, + "end": 320, "loc": { "start": { - "line": 14, - "column": 19 + "line": 10, + "column": 16 }, "end": { - "line": 14, - "column": 25 + "line": 10, + "column": 23 }, - "identifierName": "switch" + "identifierName": "switch5" }, - "name": "switch" + "name": "switch5" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 313, + "end": 320, + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 23 + }, + "identifierName": "switch5" + }, + "name": "switch5" } } ], "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 463, - "end": 468, + "start": 328, + "end": 333, "loc": { "start": { - "line": 14, + "line": 10, "column": 31 }, "end": { - "line": 14, + "line": 10, "column": 36 } }, @@ -1248,6 +900,234 @@ }, "value": "foo" } + }, + { + "type": "ImportDeclaration", + "start": 335, + "end": 376, + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 41 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 351, + "end": 362, + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "imported": { + "type": "Identifier", + "start": 351, + "end": 354, + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 358, + "end": 362, + "loc": { + "start": { + "line": 11, + "column": 23 + }, + "end": { + "line": 11, + "column": 27 + }, + "identifierName": "bar6" + }, + "name": "bar6" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 370, + "end": 375, + "loc": { + "start": { + "line": 11, + "column": 35 + }, + "end": { + "line": 11, + "column": 40 + } + }, + "extra": { + "rawValue": "baz", + "raw": "\"baz\"" + }, + "value": "baz" + } + }, + { + "type": "ImportDeclaration", + "start": 377, + "end": 411, + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 391, + "end": 399, + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 396, + "end": 399, + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 22 + }, + "identifierName": "ns7" + }, + "name": "ns7" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 405, + "end": 410, + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + }, + { + "type": "ImportDeclaration", + "start": 412, + "end": 450, + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 426, + "end": 438, + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "local": { + "type": "Identifier", + "start": 431, + "end": 438, + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 26 + }, + "identifierName": "switch8" + }, + "name": "switch8" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 444, + "end": 449, + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/input.js b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/input.js index faa1bc88ae..c434fce2a0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/input.js +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/input.js @@ -1,22 +1,22 @@ -type A = T -type A = T -type A = T -type A = T -type A = T -class A {} -class A {} -class A {} -class A {} -;(class A {}) -;(class A {}) -;(class A {}) -;(class A {}) -declare class A {} -declare class A {} -declare class A {} -declare class A {} -interface A {} -interface A {} -interface A {} -interface A {} -type A = T +type A1 = T +type A2 = T +type A3 = T +type A4 = T +type A5 = T +class A6 {} +class A7 {} +class A8 {} +class A9 {} +;(class A10 {}) +;(class A11 {}) +;(class A12 {}) +;(class A13 {}) +declare class A14 {} +declare class A15 {} +declare class A16 {} +declare class A17 {} +interface A18 {} +interface A19 {} +interface A20 {} +interface A21 {} +type A22 = T diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json index 28f3fe7384..e97815d406 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 768, + "end": 803, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 22, - "column": 20 + "column": 22 } }, "program": { "type": "Program", "start": 0, - "end": 768, + "end": 803, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 22, - "column": 20 + "column": 22 } }, "sourceType": "module", @@ -32,7 +32,7 @@ { "type": "TypeAlias", "start": 0, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "id": { "type": "Identifier", "start": 5, - "end": 6, + "end": 7, "loc": { "start": { "line": 1, @@ -54,792 +54,38 @@ }, "end": { "line": 1, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "id": { - "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "ExistsTypeAnnotation", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 41, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "id": { - "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 47, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 27 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 26 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 51, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 17 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 26 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 73, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "id": { - "type": "Identifier", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 79, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 8 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 83, - "end": 102, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 29 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 84, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 86, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 87, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 20 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 96, - "end": 102, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 29 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 106, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 106, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 108, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "id": { - "type": "Identifier", - "start": 113, - "end": 114, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 114, - "end": 147, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 39 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 115, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 17 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 119, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 17 - } - } - } - }, - { - "type": "TypeParameter", - "start": 127, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 128, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 29 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 130, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 29 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 131, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 29 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 140, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 32 - }, - "end": { - "line": 5, - "column": 38 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 150, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 150, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 43 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "ClassDeclaration", - "start": 152, - "end": 174, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 158, - "end": 159, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, "column": 7 }, - "identifierName": "A" + "identifierName": "A1" }, - "name": "A" + "name": "A1" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 159, - "end": 171, + "start": 7, + "end": 19, "loc": { "start": { - "line": 6, + "line": 1, "column": 7 }, "end": { - "line": 6, + "line": 1, "column": 19 } }, "params": [ { "type": "TypeParameter", - "start": 160, - "end": 170, + "start": 8, + "end": 18, "loc": { "start": { - "line": 6, + "line": 1, "column": 8 }, "end": { - "line": 6, + "line": 1, "column": 18 } }, @@ -847,15 +93,15 @@ "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 164, - "end": 170, + "start": 12, + "end": 18, "loc": { "start": { - "line": 6, + "line": 1, "column": 12 }, "end": { - "line": 6, + "line": 1, "column": 18 } } @@ -863,81 +109,211 @@ } ] }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 172, - "end": 174, + "right": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 23, "loc": { "start": { - "line": 6, - "column": 20 + "line": 1, + "column": 22 }, "end": { - "line": 6, - "column": 22 + "line": 1, + "column": 23 } }, - "body": [] + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "T" + }, + "name": "T" + } } }, { - "type": "ClassDeclaration", - "start": 175, - "end": 206, + "type": "TypeAlias", + "start": 24, + "end": 42, "loc": { "start": { - "line": 7, + "line": 2, "column": 0 }, "end": { - "line": 7, - "column": 31 + "line": 2, + "column": 18 } }, "id": { "type": "Identifier", - "start": 181, - "end": 182, + "start": 29, + "end": 31, "loc": { "start": { - "line": 7, - "column": 6 + "line": 2, + "column": 5 }, "end": { - "line": 7, + "line": 2, "column": 7 }, - "identifierName": "A" + "identifierName": "A2" }, - "name": "A" + "name": "A2" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 182, - "end": 203, + "start": 31, + "end": 38, "loc": { "start": { - "line": 7, + "line": 2, "column": 7 }, "end": { - "line": 7, + "line": 2, + "column": 14 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "name": "T", + "variance": null, + "default": { + "type": "ExistsTypeAnnotation", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + "right": { + "type": "GenericTypeAnnotation", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + { + "type": "TypeAlias", + "start": 43, + "end": 75, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "A3" + }, + "name": "A3" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 50, + "end": 71, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, "column": 28 } }, "params": [ { "type": "TypeParameter", - "start": 183, - "end": 202, + "start": 51, + "end": 70, "loc": { "start": { - "line": 7, + "line": 3, "column": 8 }, "end": { - "line": 7, + "line": 3, "column": 27 } }, @@ -945,43 +321,43 @@ "variance": null, "bound": { "type": "TypeAnnotation", - "start": 184, - "end": 193, + "start": 52, + "end": 61, "loc": { "start": { - "line": 7, + "line": 3, "column": 9 }, "end": { - "line": 7, + "line": 3, "column": 18 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 186, - "end": 193, + "start": 54, + "end": 61, "loc": { "start": { - "line": 7, + "line": 3, "column": 11 }, "end": { - "line": 7, + "line": 3, "column": 18 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 187, - "end": 193, + "start": 55, + "end": 61, "loc": { "start": { - "line": 7, + "line": 3, "column": 12 }, "end": { - "line": 7, + "line": 3, "column": 18 } } @@ -990,15 +366,15 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 196, - "end": 202, + "start": 64, + "end": 70, "loc": { "start": { - "line": 7, + "line": 3, "column": 21 }, "end": { - "line": 7, + "line": 3, "column": 27 } } @@ -1006,81 +382,97 @@ } ] }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 204, - "end": 206, + "right": { + "type": "GenericTypeAnnotation", + "start": 74, + "end": 75, "loc": { "start": { - "line": 7, - "column": 29 + "line": 3, + "column": 31 }, "end": { - "line": 7, - "column": 31 + "line": 3, + "column": 32 } }, - "body": [] + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 74, + "end": 75, + "loc": { + "start": { + "line": 3, + "column": 31 + }, + "end": { + "line": 3, + "column": 32 + }, + "identifierName": "T" + }, + "name": "T" + } } }, { - "type": "ClassDeclaration", - "start": 207, - "end": 241, + "type": "TypeAlias", + "start": 76, + "end": 111, "loc": { "start": { - "line": 8, + "line": 4, "column": 0 }, "end": { - "line": 8, - "column": 34 + "line": 4, + "column": 35 } }, "id": { "type": "Identifier", - "start": 213, - "end": 214, + "start": 81, + "end": 83, "loc": { "start": { - "line": 8, - "column": 6 + "line": 4, + "column": 5 }, "end": { - "line": 8, + "line": 4, "column": 7 }, - "identifierName": "A" + "identifierName": "A4" }, - "name": "A" + "name": "A4" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 214, - "end": 238, + "start": 83, + "end": 107, "loc": { "start": { - "line": 8, + "line": 4, "column": 7 }, "end": { - "line": 8, + "line": 4, "column": 31 } }, "params": [ { "type": "TypeParameter", - "start": 215, - "end": 216, + "start": 84, + "end": 85, "loc": { "start": { - "line": 8, + "line": 4, "column": 8 }, "end": { - "line": 8, + "line": 4, "column": 9 } }, @@ -1089,15 +481,15 @@ }, { "type": "TypeParameter", - "start": 218, - "end": 237, + "start": 87, + "end": 106, "loc": { "start": { - "line": 8, + "line": 4, "column": 11 }, "end": { - "line": 8, + "line": 4, "column": 30 } }, @@ -1105,43 +497,43 @@ "variance": null, "bound": { "type": "TypeAnnotation", - "start": 219, - "end": 228, + "start": 88, + "end": 97, "loc": { "start": { - "line": 8, + "line": 4, "column": 12 }, "end": { - "line": 8, + "line": 4, "column": 21 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 221, - "end": 228, + "start": 90, + "end": 97, "loc": { "start": { - "line": 8, + "line": 4, "column": 14 }, "end": { - "line": 8, + "line": 4, "column": 21 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 222, - "end": 228, + "start": 91, + "end": 97, "loc": { "start": { - "line": 8, + "line": 4, "column": 15 }, "end": { - "line": 8, + "line": 4, "column": 21 } } @@ -1150,15 +542,15 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 231, - "end": 237, + "start": 100, + "end": 106, "loc": { "start": { - "line": 8, + "line": 4, "column": 24 }, "end": { - "line": 8, + "line": 4, "column": 30 } } @@ -1166,81 +558,97 @@ } ] }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 239, - "end": 241, + "right": { + "type": "GenericTypeAnnotation", + "start": 110, + "end": 111, "loc": { "start": { - "line": 8, - "column": 32 + "line": 4, + "column": 34 }, "end": { - "line": 8, - "column": 34 + "line": 4, + "column": 35 } }, - "body": [] + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 110, + "end": 111, + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 35 + }, + "identifierName": "T" + }, + "name": "T" + } } }, { - "type": "ClassDeclaration", - "start": 242, - "end": 285, + "type": "TypeAlias", + "start": 112, + "end": 156, "loc": { "start": { - "line": 9, + "line": 5, "column": 0 }, "end": { - "line": 9, - "column": 43 + "line": 5, + "column": 44 } }, "id": { "type": "Identifier", - "start": 248, - "end": 249, + "start": 117, + "end": 119, "loc": { "start": { - "line": 9, - "column": 6 + "line": 5, + "column": 5 }, "end": { - "line": 9, + "line": 5, "column": 7 }, - "identifierName": "A" + "identifierName": "A5" }, - "name": "A" + "name": "A5" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 249, - "end": 282, + "start": 119, + "end": 152, "loc": { "start": { - "line": 9, + "line": 5, "column": 7 }, "end": { - "line": 9, + "line": 5, "column": 40 } }, "params": [ { "type": "TypeParameter", - "start": 250, - "end": 260, + "start": 120, + "end": 130, "loc": { "start": { - "line": 9, + "line": 5, "column": 8 }, "end": { - "line": 9, + "line": 5, "column": 18 } }, @@ -1248,15 +656,15 @@ "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 254, - "end": 260, + "start": 124, + "end": 130, "loc": { "start": { - "line": 9, + "line": 5, "column": 12 }, "end": { - "line": 9, + "line": 5, "column": 18 } } @@ -1264,15 +672,15 @@ }, { "type": "TypeParameter", - "start": 262, - "end": 281, + "start": 132, + "end": 151, "loc": { "start": { - "line": 9, + "line": 5, "column": 20 }, "end": { - "line": 9, + "line": 5, "column": 39 } }, @@ -1280,43 +688,43 @@ "variance": null, "bound": { "type": "TypeAnnotation", - "start": 263, - "end": 272, + "start": 133, + "end": 142, "loc": { "start": { - "line": 9, + "line": 5, "column": 21 }, "end": { - "line": 9, + "line": 5, "column": 30 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 265, - "end": 272, + "start": 135, + "end": 142, "loc": { "start": { - "line": 9, + "line": 5, "column": 23 }, "end": { - "line": 9, + "line": 5, "column": 30 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 266, - "end": 272, + "start": 136, + "end": 142, "loc": { "start": { - "line": 9, + "line": 5, "column": 24 }, "end": { - "line": 9, + "line": 5, "column": 30 } } @@ -1325,15 +733,15 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 275, - "end": 281, + "start": 145, + "end": 151, "loc": { "start": { - "line": 9, + "line": 5, "column": 33 }, "end": { - "line": 9, + "line": 5, "column": 39 } } @@ -1341,897 +749,240 @@ } ] }, + "right": { + "type": "GenericTypeAnnotation", + "start": 155, + "end": 156, + "loc": { + "start": { + "line": 5, + "column": 43 + }, + "end": { + "line": 5, + "column": 44 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 155, + "end": 156, + "loc": { + "start": { + "line": 5, + "column": 43 + }, + "end": { + "line": 5, + "column": 44 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + { + "type": "ClassDeclaration", + "start": 157, + "end": 180, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 163, + "end": 165, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 8 + }, + "identifierName": "A6" + }, + "name": "A6" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 165, + "end": 177, + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 166, + "end": 176, + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "name": "T", + "variance": null, + "default": { + "type": "StringTypeAnnotation", + "start": 170, + "end": 176, + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 19 + } + } + } + } + ] + }, "superClass": null, "body": { "type": "ClassBody", - "start": 283, - "end": 285, + "start": 178, + "end": 180, "loc": { "start": { - "line": 9, - "column": 41 + "line": 6, + "column": 21 }, "end": { - "line": 9, - "column": 43 + "line": 6, + "column": 23 } }, "body": [] } }, { - "type": "EmptyStatement", - "start": 286, - "end": 287, + "type": "ClassDeclaration", + "start": 181, + "end": 213, "loc": { "start": { - "line": 10, + "line": 7, "column": 0 }, "end": { - "line": 10, - "column": 1 - } - } - }, - { - "type": "ExpressionStatement", - "start": 287, - "end": 313, - "loc": { - "start": { - "line": 10, - "column": 1 - }, - "end": { - "line": 11, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 288, - "end": 310, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 24 - } - }, - "id": { - "type": "Identifier", - "start": 294, - "end": 295, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 295, - "end": 307, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 21 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 296, - "end": 306, - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 20 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 300, - "end": 306, - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 20 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 308, - "end": 310, - "loc": { - "start": { - "line": 10, - "column": 22 - }, - "end": { - "line": 10, - "column": 24 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 287 - } - } - }, - { - "type": "ExpressionStatement", - "start": 313, - "end": 348, - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 12, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 314, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 33 - } - }, - "id": { - "type": "Identifier", - "start": 320, - "end": 321, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 321, - "end": 342, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 30 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 322, - "end": 341, - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 29 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 323, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 20 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 325, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 20 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 326, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 20 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 335, - "end": 341, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 29 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 343, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 31 - }, - "end": { - "line": 11, - "column": 33 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 313 - } - } - }, - { - "type": "ExpressionStatement", - "start": 348, - "end": 386, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 13, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 349, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 36 - } - }, - "id": { - "type": "Identifier", - "start": 355, - "end": 356, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 356, - "end": 380, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 33 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 357, - "end": 358, - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 11 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 360, - "end": 379, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 32 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 361, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 14 - }, - "end": { - "line": 12, - "column": 23 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 363, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 23 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 364, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 17 - }, - "end": { - "line": 12, - "column": 23 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 373, - "end": 379, - "loc": { - "start": { - "line": 12, - "column": 26 - }, - "end": { - "line": 12, - "column": 32 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 381, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 36 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 348 - } - } - }, - { - "type": "ExpressionStatement", - "start": 386, - "end": 431, - "loc": { - "start": { - "line": 13, - "column": 1 - }, - "end": { - "line": 13, - "column": 46 - } - }, - "expression": { - "type": "ClassExpression", - "start": 387, - "end": 430, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 45 - } - }, - "id": { - "type": "Identifier", - "start": 393, - "end": 394, - "loc": { - "start": { - "line": 13, - "column": 8 - }, - "end": { - "line": 13, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 394, - "end": 427, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 42 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 395, - "end": 405, - "loc": { - "start": { - "line": 13, - "column": 10 - }, - "end": { - "line": 13, - "column": 20 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 399, - "end": 405, - "loc": { - "start": { - "line": 13, - "column": 14 - }, - "end": { - "line": 13, - "column": 20 - } - } - } - }, - { - "type": "TypeParameter", - "start": 407, - "end": 426, - "loc": { - "start": { - "line": 13, - "column": 22 - }, - "end": { - "line": 13, - "column": 41 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 408, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 23 - }, - "end": { - "line": 13, - "column": 32 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 410, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 411, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 26 - }, - "end": { - "line": 13, - "column": 32 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 420, - "end": 426, - "loc": { - "start": { - "line": 13, - "column": 35 - }, - "end": { - "line": 13, - "column": 41 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 428, - "end": 430, - "loc": { - "start": { - "line": 13, - "column": 43 - }, - "end": { - "line": 13, - "column": 45 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 386 - } - } - }, - { - "type": "DeclareClass", - "start": 432, - "end": 462, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 30 + "line": 7, + "column": 32 } }, "id": { "type": "Identifier", - "start": 446, - "end": 447, + "start": 187, + "end": 189, "loc": { "start": { - "line": 14, - "column": 14 + "line": 7, + "column": 6 }, "end": { - "line": 14, - "column": 15 + "line": 7, + "column": 8 }, - "identifierName": "A" + "identifierName": "A7" }, - "name": "A" + "name": "A7" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 447, - "end": 459, + "start": 189, + "end": 210, "loc": { "start": { - "line": 14, - "column": 15 + "line": 7, + "column": 8 }, "end": { - "line": 14, - "column": 27 + "line": 7, + "column": 29 } }, "params": [ { "type": "TypeParameter", - "start": 448, - "end": 458, + "start": 190, + "end": 209, "loc": { "start": { - "line": 14, - "column": 16 + "line": 7, + "column": 9 }, "end": { - "line": 14, - "column": 26 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 452, - "end": 458, - "loc": { - "start": { - "line": 14, - "column": 20 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - } - ] - }, - "extends": [], - "implements": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 460, - "end": 462, - "loc": { - "start": { - "line": 14, - "column": 28 - }, - "end": { - "line": 14, - "column": 30 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "internalSlots": [], - "exact": false - } - }, - { - "type": "DeclareClass", - "start": 463, - "end": 502, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 39 - } - }, - "id": { - "type": "Identifier", - "start": 477, - "end": 478, - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 478, - "end": 499, - "loc": { - "start": { - "line": 15, - "column": 15 - }, - "end": { - "line": 15, - "column": 36 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 479, - "end": 498, - "loc": { - "start": { - "line": 15, - "column": 16 - }, - "end": { - "line": 15, - "column": 35 + "line": 7, + "column": 28 } }, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 480, - "end": 489, + "start": 191, + "end": 200, "loc": { "start": { - "line": 15, - "column": 17 + "line": 7, + "column": 10 }, "end": { - "line": 15, - "column": 26 + "line": 7, + "column": 19 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 482, - "end": 489, + "start": 193, + "end": 200, "loc": { "start": { - "line": 15, - "column": 19 + "line": 7, + "column": 12 }, "end": { - "line": 15, - "column": 26 + "line": 7, + "column": 19 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 483, - "end": 489, + "start": 194, + "end": 200, "loc": { "start": { - "line": 15, - "column": 20 + "line": 7, + "column": 13 }, "end": { - "line": 15, - "column": 26 + "line": 7, + "column": 19 } } } @@ -2239,104 +990,98 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 492, - "end": 498, + "start": 203, + "end": 209, "loc": { "start": { - "line": 15, - "column": 29 + "line": 7, + "column": 22 }, "end": { - "line": 15, - "column": 35 + "line": 7, + "column": 28 } } } } ] }, - "extends": [], - "implements": [], - "mixins": [], + "superClass": null, "body": { - "type": "ObjectTypeAnnotation", - "start": 500, - "end": 502, + "type": "ClassBody", + "start": 211, + "end": 213, "loc": { "start": { - "line": 15, - "column": 37 + "line": 7, + "column": 30 }, "end": { - "line": 15, - "column": 39 + "line": 7, + "column": 32 } }, - "callProperties": [], - "properties": [], - "indexers": [], - "internalSlots": [], - "exact": false + "body": [] } }, { - "type": "DeclareClass", - "start": 503, - "end": 545, + "type": "ClassDeclaration", + "start": 214, + "end": 249, "loc": { "start": { - "line": 16, + "line": 8, "column": 0 }, "end": { - "line": 16, - "column": 42 + "line": 8, + "column": 35 } }, "id": { "type": "Identifier", - "start": 517, - "end": 518, + "start": 220, + "end": 222, "loc": { "start": { - "line": 16, - "column": 14 + "line": 8, + "column": 6 }, "end": { - "line": 16, - "column": 15 + "line": 8, + "column": 8 }, - "identifierName": "A" + "identifierName": "A8" }, - "name": "A" + "name": "A8" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 518, - "end": 542, + "start": 222, + "end": 246, "loc": { "start": { - "line": 16, - "column": 15 + "line": 8, + "column": 8 }, "end": { - "line": 16, - "column": 39 + "line": 8, + "column": 32 } }, "params": [ { "type": "TypeParameter", - "start": 519, - "end": 520, + "start": 223, + "end": 224, "loc": { "start": { - "line": 16, - "column": 16 + "line": 8, + "column": 9 }, "end": { - "line": 16, - "column": 17 + "line": 8, + "column": 10 } }, "name": "S", @@ -2344,449 +1089,15 @@ }, { "type": "TypeParameter", - "start": 522, - "end": 541, + "start": 226, + "end": 245, "loc": { "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 38 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 523, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 29 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 525, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 29 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 526, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 535, - "end": 541, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 38 - } - } - } - } - ] - }, - "extends": [], - "implements": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 543, - "end": 545, - "loc": { - "start": { - "line": 16, - "column": 40 - }, - "end": { - "line": 16, - "column": 42 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "internalSlots": [], - "exact": false - } - }, - { - "type": "DeclareClass", - "start": 546, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 51 - } - }, - "id": { - "type": "Identifier", - "start": 560, - "end": 561, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 561, - "end": 594, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 48 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 562, - "end": 572, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 26 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 566, - "end": 572, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - }, - { - "type": "TypeParameter", - "start": 574, - "end": 593, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 47 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 575, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 38 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 577, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 38 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 578, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 38 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 587, - "end": 593, - "loc": { - "start": { - "line": 17, - "column": 41 - }, - "end": { - "line": 17, - "column": 47 - } - } - } - } - ] - }, - "extends": [], - "implements": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 595, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 49 - }, - "end": { - "line": 17, - "column": 51 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "internalSlots": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 598, - "end": 624, - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 26 - } - }, - "id": { - "type": "Identifier", - "start": 608, - "end": 609, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 609, - "end": 621, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 23 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 610, - "end": 620, - "loc": { - "start": { - "line": 18, + "line": 8, "column": 12 }, "end": { - "line": 18, - "column": 22 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 614, - "end": 620, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - } - ] - }, - "extends": [], - "implements": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 622, - "end": 624, - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 26 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "internalSlots": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 625, - "end": 660, - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 35 - } - }, - "id": { - "type": "Identifier", - "start": 635, - "end": 636, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 636, - "end": 657, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 32 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 637, - "end": 656, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, + "line": 8, "column": 31 } }, @@ -2794,43 +1105,43 @@ "variance": null, "bound": { "type": "TypeAnnotation", - "start": 638, - "end": 647, + "start": 227, + "end": 236, "loc": { "start": { - "line": 19, + "line": 8, "column": 13 }, "end": { - "line": 19, + "line": 8, "column": 22 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 640, - "end": 647, + "start": 229, + "end": 236, "loc": { "start": { - "line": 19, + "line": 8, "column": 15 }, "end": { - "line": 19, + "line": 8, "column": 22 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 641, - "end": 647, + "start": 230, + "end": 236, "loc": { "start": { - "line": 19, + "line": 8, "column": 16 }, "end": { - "line": 19, + "line": 8, "column": 22 } } @@ -2839,15 +1150,15 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 650, - "end": 656, + "start": 239, + "end": 245, "loc": { "start": { - "line": 19, + "line": 8, "column": 25 }, "end": { - "line": 19, + "line": 8, "column": 31 } } @@ -2855,21 +1166,961 @@ } ] }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 247, + "end": 249, + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 35 + } + }, + "body": [] + } + }, + { + "type": "ClassDeclaration", + "start": 250, + "end": 294, + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 256, + "end": 258, + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 8 + }, + "identifierName": "A9" + }, + "name": "A9" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 258, + "end": 291, + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 259, + "end": 269, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "name": "S", + "variance": null, + "default": { + "type": "NumberTypeAnnotation", + "start": 263, + "end": 269, + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 19 + } + } + } + }, + { + "type": "TypeParameter", + "start": 271, + "end": 290, + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 272, + "end": 281, + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 274, + "end": 281, + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 275, + "end": 281, + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 31 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 284, + "end": 290, + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 292, + "end": 294, + "loc": { + "start": { + "line": 9, + "column": 42 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 295, + "end": 296, + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + } + }, + { + "type": "ExpressionStatement", + "start": 296, + "end": 324, + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "expression": { + "type": "ClassExpression", + "start": 297, + "end": 321, + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 303, + "end": 306, + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 11 + }, + "identifierName": "A10" + }, + "name": "A10" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 306, + "end": 318, + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 307, + "end": 317, + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "name": "T", + "variance": null, + "default": { + "type": "StringTypeAnnotation", + "start": 311, + "end": 317, + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 22 + } + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 319, + "end": 321, + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 296 + } + } + }, + { + "type": "ExpressionStatement", + "start": 324, + "end": 361, + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "expression": { + "type": "ClassExpression", + "start": 325, + "end": 358, + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 331, + "end": 334, + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 11 + }, + "identifierName": "A11" + }, + "name": "A11" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 334, + "end": 355, + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 32 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 335, + "end": 354, + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 31 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 336, + "end": 345, + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 338, + "end": 345, + "loc": { + "start": { + "line": 11, + "column": 15 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 339, + "end": 345, + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 22 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 348, + "end": 354, + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 31 + } + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 356, + "end": 358, + "loc": { + "start": { + "line": 11, + "column": 33 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 324 + } + } + }, + { + "type": "ExpressionStatement", + "start": 361, + "end": 401, + "loc": { + "start": { + "line": 12, + "column": 1 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "expression": { + "type": "ClassExpression", + "start": 362, + "end": 398, + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 368, + "end": 371, + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 11 + }, + "identifierName": "A12" + }, + "name": "A12" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 371, + "end": 395, + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 372, + "end": 373, + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "name": "S", + "variance": null + }, + { + "type": "TypeParameter", + "start": 375, + "end": 394, + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 376, + "end": 385, + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 378, + "end": 385, + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 379, + "end": 385, + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 25 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 388, + "end": 394, + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 34 + } + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 396, + "end": 398, + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 361 + } + } + }, + { + "type": "ExpressionStatement", + "start": 401, + "end": 448, + "loc": { + "start": { + "line": 13, + "column": 1 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "expression": { + "type": "ClassExpression", + "start": 402, + "end": 447, + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 408, + "end": 411, + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 11 + }, + "identifierName": "A13" + }, + "name": "A13" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 411, + "end": 444, + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 44 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 412, + "end": 422, + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "name": "S", + "variance": null, + "default": { + "type": "NumberTypeAnnotation", + "start": 416, + "end": 422, + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 22 + } + } + } + }, + { + "type": "TypeParameter", + "start": 424, + "end": 443, + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 43 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 425, + "end": 434, + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 427, + "end": 434, + "loc": { + "start": { + "line": 13, + "column": 27 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 428, + "end": 434, + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 34 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 437, + "end": 443, + "loc": { + "start": { + "line": 13, + "column": 37 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 445, + "end": 447, + "loc": { + "start": { + "line": 13, + "column": 45 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 401 + } + } + }, + { + "type": "DeclareClass", + "start": 449, + "end": 481, + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 463, + "end": 466, + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 17 + }, + "identifierName": "A14" + }, + "name": "A14" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 466, + "end": 478, + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 467, + "end": 477, + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "name": "T", + "variance": null, + "default": { + "type": "StringTypeAnnotation", + "start": 471, + "end": 477, + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 28 + } + } + } + } + ] + }, "extends": [], "implements": [], "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 658, - "end": 660, + "start": 479, + "end": 481, "loc": { "start": { - "line": 19, - "column": 33 + "line": 14, + "column": 30 }, "end": { - "line": 19, - "column": 35 + "line": 14, + "column": 32 } }, "callProperties": [], @@ -2880,63 +2131,212 @@ } }, { - "type": "InterfaceDeclaration", - "start": 661, - "end": 699, + "type": "DeclareClass", + "start": 482, + "end": 523, "loc": { "start": { - "line": 20, + "line": 15, "column": 0 }, "end": { - "line": 20, - "column": 38 + "line": 15, + "column": 41 } }, "id": { "type": "Identifier", - "start": 671, - "end": 672, + "start": 496, + "end": 499, "loc": { "start": { - "line": 20, - "column": 10 + "line": 15, + "column": 14 }, "end": { - "line": 20, - "column": 11 + "line": 15, + "column": 17 }, - "identifierName": "A" + "identifierName": "A15" }, - "name": "A" + "name": "A15" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 672, - "end": 696, + "start": 499, + "end": 520, "loc": { "start": { - "line": 20, - "column": 11 + "line": 15, + "column": 17 }, "end": { - "line": 20, - "column": 35 + "line": 15, + "column": 38 } }, "params": [ { "type": "TypeParameter", - "start": 673, - "end": 674, + "start": 500, + "end": 519, "loc": { "start": { - "line": 20, - "column": 12 + "line": 15, + "column": 18 }, "end": { - "line": 20, - "column": 13 + "line": 15, + "column": 37 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 501, + "end": 510, + "loc": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 503, + "end": 510, + "loc": { + "start": { + "line": 15, + "column": 21 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 504, + "end": 510, + "loc": { + "start": { + "line": 15, + "column": 22 + }, + "end": { + "line": 15, + "column": 28 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 513, + "end": 519, + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 37 + } + } + } + } + ] + }, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 521, + "end": 523, + "loc": { + "start": { + "line": 15, + "column": 39 + }, + "end": { + "line": 15, + "column": 41 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareClass", + "start": 524, + "end": 568, + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 538, + "end": 541, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 16, + "column": 17 + }, + "identifierName": "A16" + }, + "name": "A16" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 541, + "end": 565, + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 542, + "end": 543, + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 19 } }, "name": "S", @@ -2944,60 +2344,60 @@ }, { "type": "TypeParameter", - "start": 676, - "end": 695, + "start": 545, + "end": 564, "loc": { "start": { - "line": 20, - "column": 15 + "line": 16, + "column": 21 }, "end": { - "line": 20, - "column": 34 + "line": 16, + "column": 40 } }, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 677, - "end": 686, + "start": 546, + "end": 555, "loc": { "start": { - "line": 20, - "column": 16 + "line": 16, + "column": 22 }, "end": { - "line": 20, - "column": 25 + "line": 16, + "column": 31 } }, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 679, - "end": 686, + "start": 548, + "end": 555, "loc": { "start": { - "line": 20, - "column": 18 + "line": 16, + "column": 24 }, "end": { - "line": 20, - "column": 25 + "line": 16, + "column": 31 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 680, - "end": 686, + "start": 549, + "end": 555, "loc": { "start": { - "line": 20, - "column": 19 + "line": 16, + "column": 25 }, "end": { - "line": 20, - "column": 25 + "line": 16, + "column": 31 } } } @@ -3005,16 +2405,16 @@ }, "default": { "type": "StringTypeAnnotation", - "start": 689, - "end": 695, + "start": 558, + "end": 564, "loc": { "start": { - "line": 20, - "column": 28 + "line": 16, + "column": 34 }, "end": { - "line": 20, - "column": 34 + "line": 16, + "column": 40 } } } @@ -3026,16 +2426,197 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 697, - "end": 699, + "start": 566, + "end": 568, "loc": { "start": { - "line": 20, - "column": 36 + "line": 16, + "column": 42 }, "end": { - "line": 20, - "column": 38 + "line": 16, + "column": 44 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareClass", + "start": 569, + "end": 622, + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 583, + "end": 586, + "loc": { + "start": { + "line": 17, + "column": 14 + }, + "end": { + "line": 17, + "column": 17 + }, + "identifierName": "A17" + }, + "name": "A17" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 586, + "end": 619, + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 50 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 587, + "end": 597, + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "name": "S", + "variance": null, + "default": { + "type": "NumberTypeAnnotation", + "start": 591, + "end": 597, + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 28 + } + } + } + }, + { + "type": "TypeParameter", + "start": 599, + "end": 618, + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 600, + "end": 609, + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 602, + "end": 609, + "loc": { + "start": { + "line": 17, + "column": 33 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 603, + "end": 609, + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 40 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 612, + "end": 618, + "loc": { + "start": { + "line": 17, + "column": 43 + }, + "end": { + "line": 17, + "column": 49 + } + } + } + } + ] + }, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 620, + "end": 622, + "loc": { + "start": { + "line": 17, + "column": 51 + }, + "end": { + "line": 17, + "column": 53 } }, "callProperties": [], @@ -3047,155 +2628,78 @@ }, { "type": "InterfaceDeclaration", - "start": 700, - "end": 747, + "start": 623, + "end": 651, "loc": { "start": { - "line": 21, + "line": 18, "column": 0 }, "end": { - "line": 21, - "column": 47 + "line": 18, + "column": 28 } }, "id": { "type": "Identifier", - "start": 710, - "end": 711, + "start": 633, + "end": 636, "loc": { "start": { - "line": 21, + "line": 18, "column": 10 }, "end": { - "line": 21, - "column": 11 + "line": 18, + "column": 13 }, - "identifierName": "A" + "identifierName": "A18" }, - "name": "A" + "name": "A18" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 711, - "end": 744, + "start": 636, + "end": 648, "loc": { "start": { - "line": 21, - "column": 11 + "line": 18, + "column": 13 }, "end": { - "line": 21, - "column": 44 + "line": 18, + "column": 25 } }, "params": [ { "type": "TypeParameter", - "start": 712, - "end": 722, + "start": 637, + "end": 647, "loc": { "start": { - "line": 21, - "column": 12 + "line": 18, + "column": 14 }, "end": { - "line": 21, - "column": 22 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 716, - "end": 722, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 22 - } - } - } - }, - { - "type": "TypeParameter", - "start": 724, - "end": 743, - "loc": { - "start": { - "line": 21, + "line": 18, "column": 24 - }, - "end": { - "line": 21, - "column": 43 } }, "name": "T", "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 725, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 34 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 727, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 34 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 728, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 34 - } - } - } - } - }, "default": { "type": "StringTypeAnnotation", - "start": 737, - "end": 743, + "start": 641, + "end": 647, "loc": { "start": { - "line": 21, - "column": 37 + "line": 18, + "column": 18 }, "end": { - "line": 21, - "column": 43 + "line": 18, + "column": 24 } } } @@ -3207,16 +2711,512 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 745, - "end": 747, + "start": 649, + "end": 651, + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "InterfaceDeclaration", + "start": 652, + "end": 689, + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 662, + "end": 665, + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 13 + }, + "identifierName": "A19" + }, + "name": "A19" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 665, + "end": 686, + "loc": { + "start": { + "line": 19, + "column": 13 + }, + "end": { + "line": 19, + "column": 34 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 666, + "end": 685, + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 33 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 667, + "end": 676, + "loc": { + "start": { + "line": 19, + "column": 15 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 669, + "end": 676, + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 670, + "end": 676, + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 24 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 679, + "end": 685, + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 33 + } + } + } + } + ] + }, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 687, + "end": 689, + "loc": { + "start": { + "line": 19, + "column": 35 + }, + "end": { + "line": 19, + "column": 37 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "InterfaceDeclaration", + "start": 690, + "end": 730, + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 700, + "end": 703, + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 13 + }, + "identifierName": "A20" + }, + "name": "A20" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 703, + "end": 727, + "loc": { + "start": { + "line": 20, + "column": 13 + }, + "end": { + "line": 20, + "column": 37 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 704, + "end": 705, + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 15 + } + }, + "name": "S", + "variance": null + }, + { + "type": "TypeParameter", + "start": 707, + "end": 726, + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 36 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 708, + "end": 717, + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 710, + "end": 717, + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 711, + "end": 717, + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 27 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 720, + "end": 726, + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 36 + } + } + } + } + ] + }, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 728, + "end": 730, + "loc": { + "start": { + "line": 20, + "column": 38 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "InterfaceDeclaration", + "start": 731, + "end": 780, + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 741, + "end": 744, "loc": { "start": { "line": 21, - "column": 45 + "column": 10 }, "end": { + "line": 21, + "column": 13 + }, + "identifierName": "A21" + }, + "name": "A21" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 744, + "end": 777, + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 21, + "column": 46 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 745, + "end": 755, + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 24 + } + }, + "name": "S", + "variance": null, + "default": { + "type": "NumberTypeAnnotation", + "start": 749, + "end": 755, + "loc": { + "start": { + "line": 21, + "column": 18 + }, + "end": { + "line": 21, + "column": 24 + } + } + } + }, + { + "type": "TypeParameter", + "start": 757, + "end": 776, + "loc": { + "start": { + "line": 21, + "column": 26 + }, + "end": { + "line": 21, + "column": 45 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 758, + "end": 767, + "loc": { + "start": { + "line": 21, + "column": 27 + }, + "end": { + "line": 21, + "column": 36 + } + }, + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 760, + "end": 767, + "loc": { + "start": { + "line": 21, + "column": 29 + }, + "end": { + "line": 21, + "column": 36 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 761, + "end": 767, + "loc": { + "start": { + "line": 21, + "column": 30 + }, + "end": { + "line": 21, + "column": 36 + } + } + } + } + }, + "default": { + "type": "StringTypeAnnotation", + "start": 770, + "end": 776, + "loc": { + "start": { + "line": 21, + "column": 39 + }, + "end": { + "line": 21, + "column": 45 + } + } + } + } + ] + }, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 778, + "end": 780, + "loc": { + "start": { "line": 21, "column": 47 + }, + "end": { + "line": 21, + "column": 49 } }, "callProperties": [], @@ -3228,8 +3228,8 @@ }, { "type": "TypeAlias", - "start": 748, - "end": 768, + "start": 781, + "end": 803, "loc": { "start": { "line": 22, @@ -3237,13 +3237,13 @@ }, "end": { "line": 22, - "column": 20 + "column": 22 } }, "id": { "type": "Identifier", - "start": 753, - "end": 754, + "start": 786, + "end": 789, "loc": { "start": { "line": 22, @@ -3251,55 +3251,55 @@ }, "end": { "line": 22, - "column": 6 + "column": 8 }, - "identifierName": "A" + "identifierName": "A22" }, - "name": "A" + "name": "A22" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 754, - "end": 764, + "start": 789, + "end": 799, "loc": { "start": { "line": 22, - "column": 6 + "column": 8 }, "end": { "line": 22, - "column": 16 + "column": 18 } }, "params": [ { "type": "TypeParameter", - "start": 755, - "end": 763, + "start": 790, + "end": 798, "loc": { "start": { "line": 22, - "column": 7 + "column": 9 }, "end": { "line": 22, - "column": 15 + "column": 17 } }, "name": "T", "variance": null, "default": { "type": "VoidTypeAnnotation", - "start": 759, - "end": 763, + "start": 794, + "end": 798, "loc": { "start": { "line": 22, - "column": 11 + "column": 13 }, "end": { "line": 22, - "column": 15 + "column": 17 } } } @@ -3308,31 +3308,31 @@ }, "right": { "type": "GenericTypeAnnotation", - "start": 767, - "end": 768, + "start": 802, + "end": 803, "loc": { "start": { "line": 22, - "column": 19 + "column": 21 }, "end": { "line": 22, - "column": 20 + "column": 22 } }, "typeParameters": null, "id": { "type": "Identifier", - "start": 767, - "end": 768, + "start": 802, + "end": 803, "loc": { "start": { "line": 22, - "column": 19 + "column": 21 }, "end": { "line": 22, - "column": 20 + "column": 22 }, "identifierName": "T" }, diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js index f1829deaf2..89c03246bb 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js +++ b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js @@ -8,7 +8,7 @@ async ([a, [b: string]]) => {}; async ([a: string] = []) => {}; async ({ x: [a: string] }) => {}; -let [a: string] = c; -let [a, [b: string]] = c; -let [a: string] = c; -let { x: [a: string] } = c; +let [a1: string] = c; +let [a2, [b: string]] = c; +let [a3: string] = c; +let { x: [a4: string] } = c; diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json index 6b1de7cf02..0dc34605be 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 323, + "end": 327, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 14, - "column": 27 + "column": 28 } }, "program": { "type": "Program", "start": 0, - "end": 323, + "end": 327, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 14, - "column": 27 + "column": 28 } }, "sourceType": "module", @@ -1194,7 +1194,7 @@ { "type": "VariableDeclaration", "start": 228, - "end": 248, + "end": 249, "loc": { "start": { "line": 11, @@ -1202,14 +1202,14 @@ }, "end": { "line": 11, - "column": 20 + "column": 21 } }, "declarations": [ { "type": "VariableDeclarator", "start": 232, - "end": 247, + "end": 248, "loc": { "start": { "line": 11, @@ -1217,13 +1217,13 @@ }, "end": { "line": 11, - "column": 19 + "column": 20 } }, "id": { "type": "ArrayPattern", "start": 232, - "end": 243, + "end": 244, "loc": { "start": { "line": 11, @@ -1231,14 +1231,14 @@ }, "end": { "line": 11, - "column": 15 + "column": 16 } }, "elements": [ { "type": "Identifier", "start": 233, - "end": 242, + "end": 243, "loc": { "start": { "line": 11, @@ -1246,37 +1246,37 @@ }, "end": { "line": 11, - "column": 14 + "column": 15 }, - "identifierName": "a" + "identifierName": "a1" }, - "name": "a", + "name": "a1", "typeAnnotation": { "type": "TypeAnnotation", - "start": 234, - "end": 242, + "start": 235, + "end": 243, "loc": { "start": { "line": 11, - "column": 6 + "column": 7 }, "end": { "line": 11, - "column": 14 + "column": 15 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 236, - "end": 242, + "start": 237, + "end": 243, "loc": { "start": { "line": 11, - "column": 8 + "column": 9 }, "end": { "line": 11, - "column": 14 + "column": 15 } } } @@ -1286,16 +1286,16 @@ }, "init": { "type": "Identifier", - "start": 246, - "end": 247, + "start": 247, + "end": 248, "loc": { "start": { "line": 11, - "column": 18 + "column": 19 }, "end": { "line": 11, - "column": 19 + "column": 20 }, "identifierName": "c" }, @@ -1307,8 +1307,8 @@ }, { "type": "VariableDeclaration", - "start": 249, - "end": 274, + "start": 250, + "end": 276, "loc": { "start": { "line": 12, @@ -1316,14 +1316,14 @@ }, "end": { "line": 12, - "column": 25 + "column": 26 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 253, - "end": 273, + "start": 254, + "end": 275, "loc": { "start": { "line": 12, @@ -1331,13 +1331,13 @@ }, "end": { "line": 12, - "column": 24 + "column": 25 } }, "id": { "type": "ArrayPattern", - "start": 253, - "end": 269, + "start": 254, + "end": 271, "loc": { "start": { "line": 12, @@ -1345,14 +1345,14 @@ }, "end": { "line": 12, - "column": 20 + "column": 21 } }, "elements": [ { "type": "Identifier", - "start": 254, - "end": 255, + "start": 255, + "end": 257, "loc": { "start": { "line": 12, @@ -1360,69 +1360,69 @@ }, "end": { "line": 12, - "column": 6 + "column": 7 }, - "identifierName": "a" + "identifierName": "a2" }, - "name": "a" + "name": "a2" }, { "type": "ArrayPattern", - "start": 257, - "end": 268, + "start": 259, + "end": 270, "loc": { "start": { "line": 12, - "column": 8 + "column": 9 }, "end": { "line": 12, - "column": 19 + "column": 20 } }, "elements": [ { "type": "Identifier", - "start": 258, - "end": 267, + "start": 260, + "end": 269, "loc": { "start": { "line": 12, - "column": 9 + "column": 10 }, "end": { "line": 12, - "column": 18 + "column": 19 }, "identifierName": "b" }, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 259, - "end": 267, + "start": 261, + "end": 269, "loc": { "start": { "line": 12, - "column": 10 + "column": 11 }, "end": { "line": 12, - "column": 18 + "column": 19 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 261, - "end": 267, + "start": 263, + "end": 269, "loc": { "start": { "line": 12, - "column": 12 + "column": 13 }, "end": { "line": 12, - "column": 18 + "column": 19 } } } @@ -1434,16 +1434,16 @@ }, "init": { "type": "Identifier", - "start": 272, - "end": 273, + "start": 274, + "end": 275, "loc": { "start": { "line": 12, - "column": 23 + "column": 24 }, "end": { "line": 12, - "column": 24 + "column": 25 }, "identifierName": "c" }, @@ -1455,8 +1455,8 @@ }, { "type": "VariableDeclaration", - "start": 275, - "end": 295, + "start": 277, + "end": 298, "loc": { "start": { "line": 13, @@ -1464,14 +1464,14 @@ }, "end": { "line": 13, - "column": 20 + "column": 21 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 279, - "end": 294, + "start": 281, + "end": 297, "loc": { "start": { "line": 13, @@ -1479,13 +1479,13 @@ }, "end": { "line": 13, - "column": 19 + "column": 20 } }, "id": { "type": "ArrayPattern", - "start": 279, - "end": 290, + "start": 281, + "end": 293, "loc": { "start": { "line": 13, @@ -1493,14 +1493,14 @@ }, "end": { "line": 13, - "column": 15 + "column": 16 } }, "elements": [ { "type": "Identifier", - "start": 280, - "end": 289, + "start": 282, + "end": 292, "loc": { "start": { "line": 13, @@ -1508,37 +1508,37 @@ }, "end": { "line": 13, - "column": 14 + "column": 15 }, - "identifierName": "a" + "identifierName": "a3" }, - "name": "a", + "name": "a3", "typeAnnotation": { "type": "TypeAnnotation", - "start": 281, - "end": 289, + "start": 284, + "end": 292, "loc": { "start": { "line": 13, - "column": 6 + "column": 7 }, "end": { "line": 13, - "column": 14 + "column": 15 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 283, - "end": 289, + "start": 286, + "end": 292, "loc": { "start": { "line": 13, - "column": 8 + "column": 9 }, "end": { "line": 13, - "column": 14 + "column": 15 } } } @@ -1548,16 +1548,16 @@ }, "init": { "type": "Identifier", - "start": 293, - "end": 294, + "start": 296, + "end": 297, "loc": { "start": { "line": 13, - "column": 18 + "column": 19 }, "end": { "line": 13, - "column": 19 + "column": 20 }, "identifierName": "c" }, @@ -1569,8 +1569,8 @@ }, { "type": "VariableDeclaration", - "start": 296, - "end": 323, + "start": 299, + "end": 327, "loc": { "start": { "line": 14, @@ -1578,14 +1578,14 @@ }, "end": { "line": 14, - "column": 27 + "column": 28 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 300, - "end": 322, + "start": 303, + "end": 326, "loc": { "start": { "line": 14, @@ -1593,13 +1593,13 @@ }, "end": { "line": 14, - "column": 26 + "column": 27 } }, "id": { "type": "ObjectPattern", - "start": 300, - "end": 318, + "start": 303, + "end": 322, "loc": { "start": { "line": 14, @@ -1607,14 +1607,14 @@ }, "end": { "line": 14, - "column": 22 + "column": 23 } }, "properties": [ { "type": "ObjectProperty", - "start": 302, - "end": 316, + "start": 305, + "end": 320, "loc": { "start": { "line": 14, @@ -1622,14 +1622,14 @@ }, "end": { "line": 14, - "column": 20 + "column": 21 } }, "method": false, "key": { "type": "Identifier", - "start": 302, - "end": 303, + "start": 305, + "end": 306, "loc": { "start": { "line": 14, @@ -1647,8 +1647,8 @@ "shorthand": false, "value": { "type": "ArrayPattern", - "start": 305, - "end": 316, + "start": 308, + "end": 320, "loc": { "start": { "line": 14, @@ -1656,14 +1656,14 @@ }, "end": { "line": 14, - "column": 20 + "column": 21 } }, "elements": [ { "type": "Identifier", - "start": 306, - "end": 315, + "start": 309, + "end": 319, "loc": { "start": { "line": 14, @@ -1671,37 +1671,37 @@ }, "end": { "line": 14, - "column": 19 + "column": 20 }, - "identifierName": "a" + "identifierName": "a4" }, - "name": "a", + "name": "a4", "typeAnnotation": { "type": "TypeAnnotation", - "start": 307, - "end": 315, + "start": 311, + "end": 319, "loc": { "start": { "line": 14, - "column": 11 + "column": 12 }, "end": { "line": 14, - "column": 19 + "column": 20 } }, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 309, - "end": 315, + "start": 313, + "end": 319, "loc": { "start": { "line": 14, - "column": 13 + "column": 14 }, "end": { "line": 14, - "column": 19 + "column": 20 } } } @@ -1714,16 +1714,16 @@ }, "init": { "type": "Identifier", - "start": 321, - "end": 322, + "start": 325, + "end": 326, "loc": { "start": { "line": 14, - "column": 25 + "column": 26 }, "end": { "line": 14, - "column": 26 + "column": 27 }, "identifierName": "c" }, diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract/input.js b/packages/babel-parser/test/fixtures/typescript/class/abstract/input.js index c0a5ad4b67..33cc20fa91 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract/input.js +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract/input.js @@ -1,7 +1,7 @@ -abstract class C {} -declare abstract class C {} -export abstract class C {} +abstract class C1 {} +declare abstract class C2 {} +export abstract class C3 {} // `export abstract class {}` is not valid TypeScript. export default abstract class { } -export default abstract class C { } +export default abstract class C4 { } // `abstract class` is not valid as an expression. diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json index 2a025f917f..779c334d8f 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 250, + "end": 254, "loc": { "start": { "line": 1, @@ -15,7 +15,7 @@ "program": { "type": "Program", "start": 0, - "end": 250, + "end": 254, "loc": { "start": { "line": 1, @@ -32,7 +32,7 @@ { "type": "ClassDeclaration", "start": 0, - "end": 19, + "end": 20, "loc": { "start": { "line": 1, @@ -40,14 +40,14 @@ }, "end": { "line": 1, - "column": 19 + "column": 20 } }, "abstract": true, "id": { "type": "Identifier", "start": 15, - "end": 16, + "end": 17, "loc": { "start": { "line": 1, @@ -55,25 +55,25 @@ }, "end": { "line": 1, - "column": 16 + "column": 17 }, - "identifierName": "C" + "identifierName": "C1" }, - "name": "C" + "name": "C1" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 19, + "start": 18, + "end": 20, "loc": { "start": { "line": 1, - "column": 17 + "column": 18 }, "end": { "line": 1, - "column": 19 + "column": 20 } }, "body": [] @@ -81,8 +81,8 @@ }, { "type": "ClassDeclaration", - "start": 20, - "end": 47, + "start": 21, + "end": 49, "loc": { "start": { "line": 2, @@ -90,14 +90,14 @@ }, "end": { "line": 2, - "column": 27 + "column": 28 } }, "abstract": true, "id": { "type": "Identifier", - "start": 43, - "end": 44, + "start": 44, + "end": 46, "loc": { "start": { "line": 2, @@ -105,25 +105,25 @@ }, "end": { "line": 2, - "column": 24 + "column": 25 }, - "identifierName": "C" + "identifierName": "C2" }, - "name": "C" + "name": "C2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 45, - "end": 47, + "start": 47, + "end": 49, "loc": { "start": { "line": 2, - "column": 25 + "column": 26 }, "end": { "line": 2, - "column": 27 + "column": 28 } }, "body": [] @@ -132,8 +132,8 @@ }, { "type": "ExportNamedDeclaration", - "start": 48, - "end": 74, + "start": 50, + "end": 77, "loc": { "start": { "line": 3, @@ -141,15 +141,15 @@ }, "end": { "line": 3, - "column": 26 + "column": 27 } }, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 55, - "end": 74, + "start": 57, + "end": 77, "loc": { "start": { "line": 3, @@ -157,14 +157,14 @@ }, "end": { "line": 3, - "column": 26 + "column": 27 } }, "abstract": true, "id": { "type": "Identifier", - "start": 70, - "end": 71, + "start": 72, + "end": 74, "loc": { "start": { "line": 3, @@ -172,25 +172,25 @@ }, "end": { "line": 3, - "column": 23 + "column": 24 }, - "identifierName": "C" + "identifierName": "C3" }, - "name": "C" + "name": "C3" }, "superClass": null, "body": { "type": "ClassBody", - "start": 72, - "end": 74, + "start": 75, + "end": 77, "loc": { "start": { "line": 3, - "column": 24 + "column": 25 }, "end": { "line": 3, - "column": 26 + "column": 27 } }, "body": [] @@ -200,8 +200,8 @@ { "type": "CommentLine", "value": " `export abstract class {}` is not valid TypeScript.", - "start": 75, - "end": 129, + "start": 78, + "end": 132, "loc": { "start": { "line": 4, @@ -217,8 +217,8 @@ }, { "type": "ExportDefaultDeclaration", - "start": 130, - "end": 163, + "start": 133, + "end": 166, "loc": { "start": { "line": 5, @@ -231,8 +231,8 @@ }, "declaration": { "type": "ClassDeclaration", - "start": 145, - "end": 163, + "start": 148, + "end": 166, "loc": { "start": { "line": 5, @@ -247,8 +247,8 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 160, - "end": 163, + "start": 163, + "end": 166, "loc": { "start": { "line": 5, @@ -267,8 +267,8 @@ { "type": "CommentLine", "value": " `export abstract class {}` is not valid TypeScript.", - "start": 75, - "end": 129, + "start": 78, + "end": 132, "loc": { "start": { "line": 4, @@ -284,8 +284,8 @@ }, { "type": "ExportDefaultDeclaration", - "start": 164, - "end": 199, + "start": 167, + "end": 203, "loc": { "start": { "line": 6, @@ -293,13 +293,13 @@ }, "end": { "line": 6, - "column": 35 + "column": 36 } }, "declaration": { "type": "ClassDeclaration", - "start": 179, - "end": 199, + "start": 182, + "end": 203, "loc": { "start": { "line": 6, @@ -307,13 +307,13 @@ }, "end": { "line": 6, - "column": 35 + "column": 36 } }, "id": { "type": "Identifier", - "start": 194, - "end": 195, + "start": 197, + "end": 199, "loc": { "start": { "line": 6, @@ -321,25 +321,25 @@ }, "end": { "line": 6, - "column": 31 + "column": 32 }, - "identifierName": "C" + "identifierName": "C4" }, - "name": "C" + "name": "C4" }, "superClass": null, "body": { "type": "ClassBody", - "start": 196, - "end": 199, + "start": 200, + "end": 203, "loc": { "start": { "line": 6, - "column": 32 + "column": 33 }, "end": { "line": 6, - "column": 35 + "column": 36 } }, "body": [] @@ -350,8 +350,8 @@ { "type": "CommentLine", "value": " `abstract class` is not valid as an expression.", - "start": 200, - "end": 250, + "start": 204, + "end": 254, "loc": { "start": { "line": 7, @@ -372,8 +372,8 @@ { "type": "CommentLine", "value": " `export abstract class {}` is not valid TypeScript.", - "start": 75, - "end": 129, + "start": 78, + "end": 132, "loc": { "start": { "line": 4, @@ -388,8 +388,8 @@ { "type": "CommentLine", "value": " `abstract class` is not valid as an expression.", - "start": 200, - "end": 250, + "start": 204, + "end": 254, "loc": { "start": { "line": 7, diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/input.js b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/input.js index d2cea8ee69..cdde314da1 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/input.js +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/input.js @@ -1,2 +1,2 @@ -let x: true; -let x: false; +let x1: true; +let x2: false; diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json index 9364a60d3a..44bc4f2acb 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 26, + "end": 28, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 2, - "column": 13 + "column": 14 } }, "program": { "type": "Program", "start": 0, - "end": 26, + "end": 28, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 2, - "column": 13 + "column": 14 } }, "sourceType": "module", @@ -32,7 +32,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 12, + "end": 13, "loc": { "start": { "line": 1, @@ -40,14 +40,14 @@ }, "end": { "line": 1, - "column": 12 + "column": 13 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 11, + "end": 12, "loc": { "start": { "line": 1, @@ -55,13 +55,13 @@ }, "end": { "line": 1, - "column": 11 + "column": 12 } }, "id": { "type": "Identifier", "start": 4, - "end": 11, + "end": 12, "loc": { "start": { "line": 1, @@ -69,51 +69,51 @@ }, "end": { "line": 1, - "column": 11 + "column": 12 }, - "identifierName": "x" + "identifierName": "x1" }, - "name": "x", + "name": "x1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 11, + "start": 6, + "end": 12, "loc": { "start": { "line": 1, - "column": 5 + "column": 6 }, "end": { "line": 1, - "column": 11 + "column": 12 } }, "typeAnnotation": { "type": "TSLiteralType", - "start": 7, - "end": 11, + "start": 8, + "end": 12, "loc": { "start": { "line": 1, - "column": 7 + "column": 8 }, "end": { "line": 1, - "column": 11 + "column": 12 } }, "literal": { "type": "BooleanLiteral", - "start": 7, - "end": 11, + "start": 8, + "end": 12, "loc": { "start": { "line": 1, - "column": 7 + "column": 8 }, "end": { "line": 1, - "column": 11 + "column": 12 } }, "value": true @@ -128,8 +128,8 @@ }, { "type": "VariableDeclaration", - "start": 13, - "end": 26, + "start": 14, + "end": 28, "loc": { "start": { "line": 2, @@ -137,14 +137,14 @@ }, "end": { "line": 2, - "column": 13 + "column": 14 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 25, + "start": 18, + "end": 27, "loc": { "start": { "line": 2, @@ -152,13 +152,13 @@ }, "end": { "line": 2, - "column": 12 + "column": 13 } }, "id": { "type": "Identifier", - "start": 17, - "end": 25, + "start": 18, + "end": 27, "loc": { "start": { "line": 2, @@ -166,51 +166,51 @@ }, "end": { "line": 2, - "column": 12 + "column": 13 }, - "identifierName": "x" + "identifierName": "x2" }, - "name": "x", + "name": "x2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 18, - "end": 25, + "start": 20, + "end": 27, "loc": { "start": { "line": 2, - "column": 5 + "column": 6 }, "end": { "line": 2, - "column": 12 + "column": 13 } }, "typeAnnotation": { "type": "TSLiteralType", - "start": 20, - "end": 25, + "start": 22, + "end": 27, "loc": { "start": { "line": 2, - "column": 7 + "column": 8 }, "end": { "line": 2, - "column": 12 + "column": 13 } }, "literal": { "type": "BooleanLiteral", - "start": 20, - "end": 25, + "start": 22, + "end": 27, "loc": { "start": { "line": 2, - "column": 7 + "column": 8 }, "end": { "line": 2, - "column": 12 + "column": 13 } }, "value": false diff --git a/packages/babel-parser/test/fixtures/typescript/types/mapped/input.js b/packages/babel-parser/test/fixtures/typescript/types/mapped/input.js index d07cdba17f..4ea2b0c8a9 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/mapped/input.js +++ b/packages/babel-parser/test/fixtures/typescript/types/mapped/input.js @@ -1,4 +1,4 @@ -let map: { [P in string]: number; }; -let map: { readonly [P in string]?: number; }; -let map: { +readonly [P in string]+?: number; }; -let map: { -readonly [P in string]-?: number }; +let map1: { [P in string]: number; }; +let map2: { readonly [P in string]?: number; }; +let map3: { +readonly [P in string]+?: number; }; +let map4: { -readonly [P in string]-?: number }; diff --git a/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json b/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json index 97836b3191..5cde8240b2 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 180, + "end": 184, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 4, - "column": 47 + "column": 48 } }, "program": { "type": "Program", "start": 0, - "end": 180, + "end": 184, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 4, - "column": 47 + "column": 48 } }, "sourceType": "module", @@ -32,7 +32,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 36, + "end": 37, "loc": { "start": { "line": 1, @@ -40,14 +40,14 @@ }, "end": { "line": 1, - "column": 36 + "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 35, + "end": 36, "loc": { "start": { "line": 1, @@ -55,13 +55,13 @@ }, "end": { "line": 1, - "column": 35 + "column": 36 } }, "id": { "type": "Identifier", "start": 4, - "end": 35, + "end": 36, "loc": { "start": { "line": 1, @@ -69,82 +69,82 @@ }, "end": { "line": 1, - "column": 35 + "column": 36 }, - "identifierName": "map" + "identifierName": "map1" }, - "name": "map", + "name": "map1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 7, - "end": 35, + "start": 8, + "end": 36, "loc": { "start": { "line": 1, - "column": 7 + "column": 8 }, "end": { "line": 1, - "column": 35 + "column": 36 } }, "typeAnnotation": { "type": "TSMappedType", - "start": 9, - "end": 35, + "start": 10, + "end": 36, "loc": { "start": { "line": 1, - "column": 9 + "column": 10 }, "end": { "line": 1, - "column": 35 + "column": 36 } }, "typeParameter": { "type": "TSTypeParameter", - "start": 12, - "end": 23, + "start": 13, + "end": 24, "loc": { "start": { "line": 1, - "column": 12 + "column": 13 }, "end": { "line": 1, - "column": 23 + "column": 24 } }, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 17, - "end": 23, + "start": 18, + "end": 24, "loc": { "start": { "line": 1, - "column": 17 + "column": 18 }, "end": { "line": 1, - "column": 23 + "column": 24 } } } }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 26, - "end": 32, + "start": 27, + "end": 33, "loc": { "start": { "line": 1, - "column": 26 + "column": 27 }, "end": { "line": 1, - "column": 32 + "column": 33 } } } @@ -158,8 +158,8 @@ }, { "type": "VariableDeclaration", - "start": 37, - "end": 83, + "start": 38, + "end": 85, "loc": { "start": { "line": 2, @@ -167,14 +167,14 @@ }, "end": { "line": 2, - "column": 46 + "column": 47 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 41, - "end": 82, + "start": 42, + "end": 84, "loc": { "start": { "line": 2, @@ -182,13 +182,13 @@ }, "end": { "line": 2, - "column": 45 + "column": 46 } }, "id": { "type": "Identifier", - "start": 41, - "end": 82, + "start": 42, + "end": 84, "loc": { "start": { "line": 2, @@ -196,67 +196,67 @@ }, "end": { "line": 2, - "column": 45 + "column": 46 }, - "identifierName": "map" + "identifierName": "map2" }, - "name": "map", + "name": "map2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 44, - "end": 82, + "start": 46, + "end": 84, "loc": { "start": { "line": 2, - "column": 7 + "column": 8 }, "end": { "line": 2, - "column": 45 + "column": 46 } }, "typeAnnotation": { "type": "TSMappedType", - "start": 46, - "end": 82, + "start": 48, + "end": 84, "loc": { "start": { "line": 2, - "column": 9 + "column": 10 }, "end": { "line": 2, - "column": 45 + "column": 46 } }, "readonly": true, "typeParameter": { "type": "TSTypeParameter", - "start": 58, - "end": 69, + "start": 60, + "end": 71, "loc": { "start": { "line": 2, - "column": 21 + "column": 22 }, "end": { "line": 2, - "column": 32 + "column": 33 } }, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 63, - "end": 69, + "start": 65, + "end": 71, "loc": { "start": { "line": 2, - "column": 26 + "column": 27 }, "end": { "line": 2, - "column": 32 + "column": 33 } } } @@ -264,16 +264,16 @@ "optional": true, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 73, - "end": 79, + "start": 75, + "end": 81, "loc": { "start": { "line": 2, - "column": 36 + "column": 37 }, "end": { "line": 2, - "column": 42 + "column": 43 } } } @@ -287,8 +287,8 @@ }, { "type": "VariableDeclaration", - "start": 84, - "end": 132, + "start": 86, + "end": 135, "loc": { "start": { "line": 3, @@ -296,14 +296,14 @@ }, "end": { "line": 3, - "column": 48 + "column": 49 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 88, - "end": 131, + "start": 90, + "end": 134, "loc": { "start": { "line": 3, @@ -311,13 +311,13 @@ }, "end": { "line": 3, - "column": 47 + "column": 48 } }, "id": { "type": "Identifier", - "start": 88, - "end": 131, + "start": 90, + "end": 134, "loc": { "start": { "line": 3, @@ -325,67 +325,67 @@ }, "end": { "line": 3, - "column": 47 + "column": 48 }, - "identifierName": "map" + "identifierName": "map3" }, - "name": "map", + "name": "map3", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 91, - "end": 131, + "start": 94, + "end": 134, "loc": { "start": { "line": 3, - "column": 7 + "column": 8 }, "end": { "line": 3, - "column": 47 + "column": 48 } }, "typeAnnotation": { "type": "TSMappedType", - "start": 93, - "end": 131, + "start": 96, + "end": 134, "loc": { "start": { "line": 3, - "column": 9 + "column": 10 }, "end": { "line": 3, - "column": 47 + "column": 48 } }, "readonly": "+", "typeParameter": { "type": "TSTypeParameter", - "start": 106, - "end": 117, + "start": 109, + "end": 120, "loc": { "start": { "line": 3, - "column": 22 + "column": 23 }, "end": { "line": 3, - "column": 33 + "column": 34 } }, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 111, - "end": 117, + "start": 114, + "end": 120, "loc": { "start": { "line": 3, - "column": 27 + "column": 28 }, "end": { "line": 3, - "column": 33 + "column": 34 } } } @@ -393,16 +393,16 @@ "optional": "+", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 122, - "end": 128, + "start": 125, + "end": 131, "loc": { "start": { "line": 3, - "column": 38 + "column": 39 }, "end": { "line": 3, - "column": 44 + "column": 45 } } } @@ -416,8 +416,8 @@ }, { "type": "VariableDeclaration", - "start": 133, - "end": 180, + "start": 136, + "end": 184, "loc": { "start": { "line": 4, @@ -425,14 +425,14 @@ }, "end": { "line": 4, - "column": 47 + "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 137, - "end": 179, + "start": 140, + "end": 183, "loc": { "start": { "line": 4, @@ -440,13 +440,13 @@ }, "end": { "line": 4, - "column": 46 + "column": 47 } }, "id": { "type": "Identifier", - "start": 137, - "end": 179, + "start": 140, + "end": 183, "loc": { "start": { "line": 4, @@ -454,67 +454,67 @@ }, "end": { "line": 4, - "column": 46 + "column": 47 }, - "identifierName": "map" + "identifierName": "map4" }, - "name": "map", + "name": "map4", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 140, - "end": 179, + "start": 144, + "end": 183, "loc": { "start": { "line": 4, - "column": 7 + "column": 8 }, "end": { "line": 4, - "column": 46 + "column": 47 } }, "typeAnnotation": { "type": "TSMappedType", - "start": 142, - "end": 179, + "start": 146, + "end": 183, "loc": { "start": { "line": 4, - "column": 9 + "column": 10 }, "end": { "line": 4, - "column": 46 + "column": 47 } }, "readonly": "-", "typeParameter": { "type": "TSTypeParameter", - "start": 155, - "end": 166, + "start": 159, + "end": 170, "loc": { "start": { "line": 4, - "column": 22 + "column": 23 }, "end": { "line": 4, - "column": 33 + "column": 34 } }, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 160, - "end": 166, + "start": 164, + "end": 170, "loc": { "start": { "line": 4, - "column": 27 + "column": 28 }, "end": { "line": 4, - "column": 33 + "column": 34 } } } @@ -522,16 +522,16 @@ "optional": "-", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 171, - "end": 177, + "start": 175, + "end": 181, "loc": { "start": { "line": 4, - "column": 38 + "column": 39 }, "end": { "line": 4, - "column": 44 + "column": 45 } } } diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/input.mjs b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/input.mjs new file mode 100644 index 0000000000..9007738a2b --- /dev/null +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/input.mjs @@ -0,0 +1 @@ +import type, { imp } from "bar"; diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/options.json b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/options.json new file mode 100644 index 0000000000..8bbb3f309f --- /dev/null +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/options.json @@ -0,0 +1 @@ +{ "plugins": ["transform-flow-strip-types", "syntax-class-properties"] } diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/output.mjs b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/output.mjs new file mode 100644 index 0000000000..9007738a2b --- /dev/null +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations-2/output.mjs @@ -0,0 +1 @@ +import type, { imp } from "bar"; diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs index 2d40466b5b..4be37364cf 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs @@ -1,29 +1,29 @@ -function foo(numVal: any) {} -function foo(numVal: number) {} -function foo(numVal: number, strVal: string) {} -function foo(numVal: number, untypedVal) {} -function foo(untypedVal, numVal: number) {} -function foo(nullableNum: ?number) {} -function foo(callback: () => void) {} -function foo(callback: () => number) {} -function foo(callback: (_: bool) => number) {} -function foo(callback: (_1: bool, _2: string) => number) {} -function foo(callback: (_1: bool, ...foo: Array) => number) {} -function foo(): number{} -function foo():() => void {} -function foo():(_:bool) => number{} -function foo():(_?:bool) => number{} -function foo(): {} {} -function foo() {} -function foo() {} -a = function() {}; -a = { set fooProp(value: number) {} }; -a = { set fooProp(value: number): void {} }; -a = { get fooProp():number{} }; -a = { id(x: T): T {} }; -a = { *id(x: T): T {} }; -a = { async id(x: T): T {} }; -a = { 123(x: T): T {} }; +function foo1(numVal: any) {} +function foo2(numVal: number) {} +function foo3(numVal: number, strVal: string) {} +function foo4(numVal: number, untypedVal) {} +function foo5(untypedVal, numVal: number) {} +function foo6(nullableNum: ?number) {} +function foo7(callback: () => void) {} +function foo8(callback: () => number) {} +function foo9(callback: (_: bool) => number) {} +function foo10(callback: (_1: bool, _2: string) => number) {} +function foo11(callback: (_1: bool, ...foo: Array) => number) {} +function foo12(): number{} +function foo13():() => void {} +function foo14():(_:bool) => number{} +function foo15():(_?:bool) => number{} +function foo16(): {} {} +function foo17() {} +function foo18() {} +a1 = function() {}; +a2 = { set fooProp(value: number) {} }; +a3 = { set fooProp(value: number): void {} }; +a4 = { get fooProp():number{} }; +a5 = { id(x: T): T {} }; +a6 = { *id(x: T): T {} }; +a7 = { async id(x: T): T {} }; +a8 = { 123(x: T): T {} }; class Foo { set fooProp(value: number) {} } @@ -35,22 +35,22 @@ class Foo3 { } var numVal: number; var numVal: number = otherNumVal; -var a: { numVal: number }; -var a: { numVal: number; }; -var a: { numVal: number; [indexer: string]: number }; -var a: ?{ numVal: number }; -var a: { numVal: number; strVal: string } -var a: { subObj: {strVal: string} } -var a: { subObj: ?{strVal: string} } -var a: { param1: number; param2: string } -var a: { param1: number; param2?: string } -var a: { ...any; ...{}|{p: void} }; -var a: { [a: number]: string; [b: number]: string; }; -var a: { add(x: number, ...y: Array): void }; -var a: { id(x: T): T; }; -var a:Array = [1, 2, 3] -a = class Foo {} -a = class Foo extends Bar {} +var a1: { numVal: number }; +var a2: { numVal: number; }; +var a3: { numVal: number; [indexer: string]: number }; +var a4: ?{ numVal: number }; +var a5: { numVal: number; strVal: string } +var a6: { subObj: {strVal: string} } +var a7: { subObj: ?{strVal: string} } +var a8: { param1: number; param2: string } +var a9: { param1: number; param2?: string } +var a10: { ...any; ...{}|{p: void} }; +var a11: { [a: number]: string; [b: number]: string; }; +var a12: { add(x: number, ...y: Array): void }; +var a13: { id(x: T): T; }; +var a14:Array = [1, 2, 3] +a13 = class Foo {} +a14 = class Foo extends Bar {} class Foo4 {} class Foo5 extends Bar {} class Foo6 extends mixin(Bar) {} @@ -60,7 +60,7 @@ class Foo7 { class Foo8 { "bar"() {} } -function foo(requiredParam, optParam?) {} +function foo19(requiredParam, optParam?) {} class Foo9 { prop1: string; prop2: number; @@ -73,32 +73,31 @@ class Foo11 { #prop1: string; #prop2: number; } -var x: number | string = 4; +var x1: number | string = 4; class Array { concat(items:number | string) {}; } -var x: () => number | () => string = fn; -var x: typeof Y = Y; -var x: typeof Y | number = Y; -var {x}: {x: string; } = { x: "hello" }; -var {x}: {x: string } = { x: "hello" }; -var [x]: Array = [ "hello" ]; -function foo({x}: { x: string; }) {} -function foo([x]: Array) {} -function foo(...rest: Array) {} +var x2: () => number | () => string = fn; +var x3: typeof Y = Y; +var x4: typeof Y | number = Y; +var {x5}: {x5: string; } = { x5: "hello" }; +var {x6}: {x6: string } = { x6: "hello" }; +var [x7]: Array = [ "hello" ]; +function foo20({x}: { x: string; }) {} +function foo21([x]: Array) {} +function foo22(...rest: Array) {} (function (...rest: Array) {}); ((...rest: Array) => rest); -var a: Map > -var a: Map> -var a: number[] -var a: ?string[] -var a: Promise[] -var a:(...rest:Array) => number -var identity: (x: T) => T -var identity: (x: T, ...y:T[]) => T -import type foo4 from "bar"; -import type { foo2, bar } from "baz"; -import type { foo as bar2 } from "baz"; +var a15: Map > +var a16: Map> +var a17: number[] +var a18: ?string[] +var a19: Promise[] +var a20:(...rest:Array) => number +var identity1: (x: T) => T +var identity2: (x: T, ...y:T[]) => T +import type imp1 from "bar"; +import type { imp2, imp3 } from "baz"; +import type { foo as imp4 } from "baz"; import type from "foo"; -import type2, { foo3 } from "bar"; import typeof * as namespace from "bar"; export type { foo }; export type { foo2 } from "bar"; @@ -106,7 +105,7 @@ import {type T} from "foo"; import {type T2, V1} from "foo"; import {typeof V2} from "foo"; import {typeof V3, V4} from "foo"; -export interface foo5 { p: number } -export interface foo6 { p: T } +export interface int5 { p: number } +export interface int6 { p: T } import 'foo'; export type * from "foo"; diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs index 74989f4e7e..8df6545f39 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs @@ -1,66 +1,66 @@ -function foo(numVal) {} +function foo1(numVal) {} -function foo(numVal) {} +function foo2(numVal) {} -function foo(numVal, strVal) {} +function foo3(numVal, strVal) {} -function foo(numVal, untypedVal) {} +function foo4(numVal, untypedVal) {} -function foo(untypedVal, numVal) {} +function foo5(untypedVal, numVal) {} -function foo(nullableNum) {} +function foo6(nullableNum) {} -function foo(callback) {} +function foo7(callback) {} -function foo(callback) {} +function foo8(callback) {} -function foo(callback) {} +function foo9(callback) {} -function foo(callback) {} +function foo10(callback) {} -function foo(callback) {} +function foo11(callback) {} -function foo() {} +function foo12() {} -function foo() {} +function foo13() {} -function foo() {} +function foo14() {} -function foo() {} +function foo15() {} -function foo() {} +function foo16() {} -function foo() {} +function foo17() {} -function foo() {} +function foo18() {} -a = function () {}; +a1 = function () {}; -a = { +a2 = { set fooProp(value) {} }; -a = { +a3 = { set fooProp(value) {} }; -a = { +a4 = { get fooProp() {} }; -a = { +a5 = { id(x) {} }; -a = { +a6 = { *id(x) {} }; -a = { +a7 = { async id(x) {} }; -a = { +a8 = { 123(x) {} }; @@ -82,22 +82,22 @@ class Foo3 { var numVal; var numVal = otherNumVal; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a; -var a = [1, 2, 3]; -a = class Foo {}; -a = class Foo extends Bar {}; +var a1; +var a2; +var a3; +var a4; +var a5; +var a6; +var a7; +var a8; +var a9; +var a10; +var a11; +var a12; +var a13; +var a14 = [1, 2, 3]; +a13 = class Foo {}; +a14 = class Foo extends Bar {}; class Foo4 {} @@ -117,7 +117,7 @@ class Foo8 { } -function foo(requiredParam, optParam) {} +function foo19(requiredParam, optParam) {} class Foo9 {} @@ -128,50 +128,49 @@ class Foo11 { #prop2; } -var x = 4; +var x1 = 4; class Array { concat(items) {} } -var x = fn; -var x = Y; -var x = Y; +var x2 = fn; +var x3 = Y; +var x4 = Y; var { - x + x5 } = { - x: "hello" + x5: "hello" }; var { - x + x6 } = { - x: "hello" + x6: "hello" }; -var [x] = ["hello"]; +var [x7] = ["hello"]; -function foo({ +function foo20({ x }) {} -function foo([x]) {} +function foo21([x]) {} -function foo(...rest) {} +function foo22(...rest) {} (function (...rest) {}); (...rest) => rest; -var a; -var a; -var a; -var a; -var a; -var a; -var identity; -var identity; +var a15; +var a16; +var a17; +var a18; +var a19; +var a20; +var identity1; +var identity2; import type from "foo"; -import type2, { foo3 } from "bar"; import { V1 } from "foo"; import { V4 } from "foo"; import 'foo'; diff --git a/packages/babel-traverse/test/arrow-transform.js b/packages/babel-traverse/test/arrow-transform.js index 78b0fb19de..f21ba52ac3 100644 --- a/packages/babel-traverse/test/arrow-transform.js +++ b/packages/babel-traverse/test/arrow-transform.js @@ -65,7 +65,7 @@ describe("arrow function conversion", () => { _supercall(); () => _supercall(); `, - { methodName: "constructor" }, + { methodName: "constructor", extend: true }, ); });