Make tests spec compliant and avoid duplicate declarations in input files (#9522)

This commit is contained in:
Daniel Tschinder 2019-02-18 16:14:35 -08:00 committed by GitHub
parent 39af228ac4
commit a1ea765b95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
84 changed files with 4635 additions and 4583 deletions

View File

@ -4,7 +4,7 @@ function foo(l) {
);
}
function foo() {
function foo2() {
return (
1 && 2
) || 3;

View File

@ -4,7 +4,7 @@ function foo(l) {
}
function foo() {
function foo2() {
return (
1 && 2 ||
3);

View File

@ -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 {}

View File

@ -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 {}
declare class A3 implements B {}
declare class A4 mixins B implements C {}
declare class A5 implements B, C {}

View File

@ -1,9 +1,9 @@
interface A {}
interface A extends B {}
interface A<T> extends B<T>, C<T> {}
interface A { foo: () => number; }
interface A1 {}
interface A2 extends B {}
interface A3<T> extends B<T>, C<T> {}
interface A4 { foo: () => number; }
interface Dictionary { [index: string]: string; length: number; }
class Foo implements Bar {}
class Foo extends Bar implements Bat, Man<number> {}
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<number> {}
class Foo3 extends class Bar implements Bat {} {}
class Foo4 extends class Bar implements Bat {} implements Man {}

View File

@ -1,7 +1,7 @@
interface A {}
interface A extends B {}
interface A<T> extends B<T>, C<T> {}
interface A {
interface A1 {}
interface A2 extends B {}
interface A3<T> extends B<T>, C<T> {}
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<number> {}
class Foo2 extends Bar implements Bat, Man<number> {}
class Foo extends class Bar implements Bat {} {}
class Foo3 extends class Bar implements Bat {} {}
class Foo extends class Bar implements Bat {} implements Man {}
class Foo4 extends class Bar implements Bat {} implements Man {}

View File

@ -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;

View File

@ -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;

View File

@ -1,2 +1,2 @@
function createElement(tagName: "div"): HTMLDivElement {}
function createElement(tagName: 'div'): HTMLDivElement {}
function createElement1(tagName: "div"): HTMLDivElement {}
function createElement2(tagName: 'div'): HTMLDivElement {}

View File

@ -1,3 +1,3 @@
function createElement(tagName: "div"): HTMLDivElement {}
function createElement1(tagName: "div"): HTMLDivElement {}
function createElement(tagName: 'div'): HTMLDivElement {}
function createElement2(tagName: 'div'): HTMLDivElement {}

View File

@ -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>) => number) {}
function foo(): number{}
function foo():() => void {}
function foo():(_:bool) => number{}
function foo():(_?:bool) => number{}
function foo(): {} {}
function foo<T>() {}
function foo<T,S>() {}
function foo<T: F>() {}
a = function<T,S>() {};
a = { set fooProp(value: number) {} };
a = { set fooProp(value: number): void {} };
a = { get fooProp():number{} };
a = { id<T>(x: T): T {} };
a = { *id<T>(x: T): T {} };
a = { async id<T>(x: T): T {} };
a = { 123<T>(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>) => number) {}
function foo12(): number{}
function foo13():() => void {}
function foo14():(_:bool) => number{}
function foo15():(_?:bool) => number{}
function foo16(): {} {}
function foo17<T>() {}
function foo18<T,S>() {}
function foo19<T: F>() {}
a1 = function<T,S>() {};
a2 = { set fooProp(value: number) {} };
a3 = { set fooProp(value: number): void {} };
a4 = { get fooProp():number{} };
a5 = { id<T>(x: T): T {} };
a6 = { *id<T>(x: T): T {} };
a7 = { async id<T>(x: T): T {} };
a8 = { 123<T>(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<string>): void };
var a: { subtract: (x: number, ...y: Array<string>) => void };
var a: { id<T>(x: T): T; };
var a:Array<number> = [1, 2, 3]
a = class Foo<T> {}
a = class Foo<T> extends Bar<T> {}
class Foo<T> {}
class Foo<T> extends Bar<T> {}
class Foo<T> extends mixin(Bar) {}
class Foo<T> {
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<string>): void };
var a12: { subtract: (x: number, ...y: Array<string>) => void };
var a13: { id<T>(x: T): T; };
var a14:Array<number> = [1, 2, 3]
a13 = class Foo<T> {}
a14 = class Foo<T> extends Bar<T> {}
class Foo4<T> {}
class Foo5<T> extends Bar<T> {}
class Foo6<T> extends mixin(Bar) {}
class Foo7<T> {
bar<U>():number { return 42; }
}
class Foo {
class Foo8 {
"bar"<T>() {}
}
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<string> = [ "hello" ];
function foo({x}: { x: string; }) {}
function foo([x]: Array<string>) {}
function foo(...rest: Array<number>) {}
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<string> = [ "hello" ];
function foo21({x}: { x: string; }) {}
function foo22([x]: Array<string>) {}
function foo23(...rest: Array<number>) {}
(function (...rest: Array<number>) {});
((...rest: Array<number>) => rest);
var a: Map<string, Array<string> >
var a: Map<string, Array<string>>
var a: number[]
var a: ?string[]
var a: Promise<bool>[]
var a:(...rest:Array<number>) => number
var identity: <T>(x: T) => T
var identity: <T>(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<string, Array<string> >
var a16: Map<string, Array<string>>
var a17: number[]
var a18: ?string[]
var a19: Promise<bool>[]
var a20:(...rest:Array<number>) => number
var identity1: <T>(x: T) => T
var identity2: <T>(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<T> { p: T }
var a: ?Array<?string>;
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<string>): void |};
var a: {| subtract: (x: number, ...y: Array<string>) => void |};
var a: {| id<T>(x: T): T; |};
function foo(numVal: number = 2) {}
function foo(numVal?: number = 2) {}
var a21: ?Array<?string>;
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<string>): void |};
var a33: {| subtract: (x: number, ...y: Array<string>) => void |};
var a34: {| id<T>(x: T): T; |};
function foo27(numVal: number = 2) {}
function foo28(numVal?: number = 2) {}
export type * from "foo";

View File

@ -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>) => number) {}
function foo11(callback: (_1: boolean, ...foo: Array<number>) => 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<T>() {}
function foo17<T>() {}
function foo<T, S>() {}
function foo18<T, S>() {}
function foo<T: F>() {}
function foo19<T: F>() {}
a = function <T, S>() {};
a1 = function <T, S>() {};
a = {
a2 = {
set fooProp(value: number) {}
};
a = {
a3 = {
set fooProp(value: number): void {}
};
a = {
a4 = {
get fooProp(): number {}
};
a = {
a5 = {
id<T>(x: T): T {}
};
a = {
a6 = {
*id<T>(x: T): T {}
};
a = {
a7 = {
async id<T>(x: T): T {}
};
a = {
a8 = {
123<T>(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<string>): void
};
var a: {
var a12: {
subtract: (x: number, ...y: Array<string>) => void
};
var a: {
var a13: {
id<T>(x: T): T
};
var a: Array<number> = [1, 2, 3];
a = class Foo<T> {};
a = class Foo<T> extends Bar<T> {};
var a14: Array<number> = [1, 2, 3];
a13 = class Foo<T> {};
a14 = class Foo<T> extends Bar<T> {};
class Foo<T> {}
class Foo4<T> {}
class Foo<T> extends Bar<T> {}
class Foo5<T> extends Bar<T> {}
class Foo<T> extends mixin(Bar) {}
class Foo6<T> extends mixin(Bar) {}
class Foo<T> {
class Foo7<T> {
bar<U>(): number {
return 42;
}
}
class Foo {
class Foo8 {
"bar"<T>() {}
}
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<string> = ["hello"];
var [x7]: Array<string> = ["hello"];
function foo({
function foo21({
x
}: {
x: string
}) {}
function foo([x]: Array<string>) {}
function foo22([x]: Array<string>) {}
function foo(...rest: Array<number>) {}
function foo23(...rest: Array<number>) {}
(function (...rest: Array<number>) {});
(...rest: Array<number>) => rest;
var a: Map<string, Array<string>>;
var a: Map<string, Array<string>>;
var a: number[];
var a: ?string[];
var a: Promise<boolean>[];
var a: (...rest: Array<number>) => number;
var identity: <T>(x: T) => T;
var identity: <T>(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<string, Array<string>>;
var a16: Map<string, Array<string>>;
var a17: number[];
var a18: ?string[];
var a19: Promise<boolean>[];
var a20: (...rest: Array<number>) => number;
var identity1: <T>(x: T) => T;
var identity2: <T>(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<T> {
p: T
}
var a: ?Array<?string>;
var a: {|
var a21: ?Array<?string>;
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<string>): void
|};
var a: {|
var a33: {|
subtract: (x: number, ...y: Array<string>) => void
|};
var a: {|
var a34: {|
id<T>(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";

View File

@ -1,21 +1,21 @@
type A<T = string> = T;
type A<T = *> = T;
type A<T: ?string = string> = T;
type A<S, T: ?string = string> = T;
type A<S = number, T: ?string = string> = T;
class A<T = string> {}
class A<T: ?string = string> {}
class A<S, T: ?string = string> {}
class A<S = number, T: ?string = string> {}
(class A<T = string> {});
(class A<T: ?string = string> {});
(class A<S, T: ?string = string> {});
(class A<S = number, T: ?string = string> {});
declare class A<T = string> {}
declare class A<T: ?string = string> {}
declare class A<S, T: ?string = string> {}
declare class A<S = number, T: ?string = string> {}
interface A<T = string> {}
interface A<T: ?string = string> {}
interface A<S, T: ?string = string> {}
interface A<S = number, T: ?string = string> {}
type A1<T = string> = T;
type A2<T = *> = T;
type A3<T: ?string = string> = T;
type A4<S, T: ?string = string> = T;
type A5<S = number, T: ?string = string> = T;
class A6<T = string> {}
class A7<T: ?string = string> {}
class A8<S, T: ?string = string> {}
class A9<S = number, T: ?string = string> {}
(class A10<T = string> {});
(class A11<T: ?string = string> {});
(class A12<S, T: ?string = string> {});
(class A13<S = number, T: ?string = string> {});
declare class A14<T = string> {}
declare class A15<T: ?string = string> {}
declare class A16<S, T: ?string = string> {}
declare class A17<S = number, T: ?string = string> {}
interface A18<T = string> {}
interface A19<T: ?string = string> {}
interface A20<S, T: ?string = string> {}
interface A21<S = number, T: ?string = string> {}

View File

@ -1,30 +1,30 @@
type A<T = string> = T;
type A<T = *> = T;
type A<T: ?string = string> = T;
type A<S, T: ?string = string> = T;
type A<S = number, T: ?string = string> = T;
type A1<T = string> = T;
type A2<T = *> = T;
type A3<T: ?string = string> = T;
type A4<S, T: ?string = string> = T;
type A5<S = number, T: ?string = string> = T;
class A<T = string> {}
class A6<T = string> {}
class A<T: ?string = string> {}
class A7<T: ?string = string> {}
class A<S, T: ?string = string> {}
class A8<S, T: ?string = string> {}
class A<S = number, T: ?string = string> {}
class A9<S = number, T: ?string = string> {}
(class A<T = string> {});
(class A10<T = string> {});
(class A<T: ?string = string> {});
(class A11<T: ?string = string> {});
(class A<S, T: ?string = string> {});
(class A12<S, T: ?string = string> {});
(class A<S = number, T: ?string = string> {});
(class A13<S = number, T: ?string = string> {});
declare class A<T = string> {}
declare class A<T: ?string = string> {}
declare class A<S, T: ?string = string> {}
declare class A<S = number, T: ?string = string> {}
interface A<T = string> {}
interface A<T: ?string = string> {}
interface A<S, T: ?string = string> {}
interface A<S = number, T: ?string = string> {}
declare class A14<T = string> {}
declare class A15<T: ?string = string> {}
declare class A16<S, T: ?string = string> {}
declare class A17<S = number, T: ?string = string> {}
interface A18<T = string> {}
interface A19<T: ?string = string> {}
interface A20<S, T: ?string = string> {}
interface A21<S = number, T: ?string = string> {}

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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";

View File

@ -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";

View File

@ -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";
import { foo as bar1 } from "foo";
import { foo as bar2, test as testing, logging } from "foo";

View File

@ -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]) => { };

View File

@ -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]) => {};
([a1, b1, ...rest1]) => {};

View File

@ -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) {}
}

View File

@ -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) {}
}

View File

@ -1,10 +1,10 @@
function foo() {
function foo1() {
return ( // foobar
"bar"
);
}
function foo() {
function foo2() {
return (
// foobar
"bar"

View File

@ -1,10 +1,10 @@
function foo() {
function foo1() {
return (// foobar
"bar"
);
}
function foo() {
function foo2() {
return (// foobar
"bar"
);

View File

@ -1,2 +1,2 @@
class Foo {}
class Foo extends Bar {}
class Foo2 extends Bar {}

View File

@ -1,3 +1,3 @@
class Foo {}
class Foo extends Bar {}
class Foo2 extends Bar {}

View File

@ -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 {}
}

View File

@ -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 {}
}

View File

@ -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 () {};

View File

@ -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 () {};

View File

@ -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";

View File

@ -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";

View File

@ -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/; }

View File

@ -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/;
}

View File

@ -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";

View File

@ -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";
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";

View File

@ -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.

View File

@ -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.
export default abstract class C4 {} // `abstract class` is not valid as an expression.

View File

@ -1,2 +1,2 @@
let x: true;
let x: false;
let x2: false;

View File

@ -1,2 +1,2 @@
let x: true;
let x: false;
let x2: false;

View File

@ -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 };

View File

@ -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 };

View File

@ -1 +0,0 @@
function null() { }

View File

@ -1,3 +0,0 @@
{
"throws": "Unexpected token (1:9)"
}

View File

@ -1 +0,0 @@
function true() { }

View File

@ -1,3 +0,0 @@
{
"throws": "Unexpected token (1:9)"
}

View File

@ -1 +0,0 @@
function false() { }

View File

@ -1,3 +0,0 @@
{
"throws": "Unexpected token (1:9)"
}

View File

@ -1 +0,0 @@
function if() { }

View File

@ -1,3 +0,0 @@
{
"throws": "Unexpected token (1:9)"
}

View File

@ -3,7 +3,7 @@ class Foo {
y
}
class Foo {
class Foo2 {
p
[m] () {}
}

View File

@ -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,

View File

@ -3,7 +3,7 @@ class Foo {
['y']
}
class Foo {
class Foo2 {
[p]
[m] () {}
}

View File

@ -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,

View File

@ -1,3 +1,3 @@
class A {
class A extends B {
foo = () => super.x();
}

View File

@ -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,

View File

@ -1,4 +1,4 @@
class A{
class A extends B {
constructor(){
super()?.b;
}

View File

@ -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,

View File

@ -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;

View File

@ -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,38 +440,24 @@
},
{
"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,
"loc": {
"start": {
"line": 2,
"column": 20
},
"end": {
"line": 2,
"column": 27
}
},
"typeAnnotation": {
"type": "GenericTypeAnnotation",
"start": 79,
"end": 85,
"end": 86,
"loc": {
"start": {
"line": 2,
@ -479,22 +465,36 @@
},
"end": {
"line": 2,
"column": 27
"column": 28
}
},
"typeAnnotation": {
"type": "GenericTypeAnnotation",
"start": 80,
"end": 86,
"loc": {
"start": {
"line": 2,
"column": 22
},
"end": {
"line": 2,
"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"
},

View File

@ -0,0 +1 @@
import type, { foo } from "bar";

View File

@ -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": []
}
}

View File

@ -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";

View File

@ -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": {

View File

@ -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";

View File

@ -1,22 +1,22 @@
type A<T = string> = T
type A<T = *> = T
type A<T: ?string = string> = T
type A<S, T: ?string = string> = T
type A<S = number, T: ?string = string> = T
class A<T = string> {}
class A<T: ?string = string> {}
class A<S, T: ?string = string> {}
class A<S = number, T: ?string = string> {}
;(class A<T = string> {})
;(class A<T: ?string = string> {})
;(class A<S, T: ?string = string> {})
;(class A<S = number, T: ?string = string> {})
declare class A<T = string> {}
declare class A<T: ?string = string> {}
declare class A<S, T: ?string = string> {}
declare class A<S = number, T: ?string = string> {}
interface A<T = string> {}
interface A<T: ?string = string> {}
interface A<S, T: ?string = string> {}
interface A<S = number, T: ?string = string> {}
type A<T = void> = T
type A1<T = string> = T
type A2<T = *> = T
type A3<T: ?string = string> = T
type A4<S, T: ?string = string> = T
type A5<S = number, T: ?string = string> = T
class A6<T = string> {}
class A7<T: ?string = string> {}
class A8<S, T: ?string = string> {}
class A9<S = number, T: ?string = string> {}
;(class A10<T = string> {})
;(class A11<T: ?string = string> {})
;(class A12<S, T: ?string = string> {})
;(class A13<S = number, T: ?string = string> {})
declare class A14<T = string> {}
declare class A15<T: ?string = string> {}
declare class A16<S, T: ?string = string> {}
declare class A17<S = number, T: ?string = string> {}
interface A18<T = string> {}
interface A19<T: ?string = string> {}
interface A20<S, T: ?string = string> {}
interface A21<S = number, T: ?string = string> {}
type A22<T = void> = T

View File

@ -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;

View File

@ -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,31 +1360,16 @@
},
"end": {
"line": 12,
"column": 6
"column": 7
},
"identifierName": "a"
"identifierName": "a2"
},
"name": "a"
"name": "a2"
},
{
"type": "ArrayPattern",
"start": 257,
"end": 268,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 19
}
},
"elements": [
{
"type": "Identifier",
"start": 258,
"end": 267,
"start": 259,
"end": 270,
"loc": {
"start": {
"line": 12,
@ -1392,15 +1377,14 @@
},
"end": {
"line": 12,
"column": 18
"column": 20
}
},
"identifierName": "b"
},
"name": "b",
"typeAnnotation": {
"type": "TypeAnnotation",
"start": 259,
"end": 267,
"elements": [
{
"type": "Identifier",
"start": 260,
"end": 269,
"loc": {
"start": {
"line": 12,
@ -1408,21 +1392,37 @@
},
"end": {
"line": 12,
"column": 18
"column": 19
},
"identifierName": "b"
},
"name": "b",
"typeAnnotation": {
"type": "TypeAnnotation",
"start": 261,
"end": 269,
"loc": {
"start": {
"line": 12,
"column": 11
},
"end": {
"line": 12,
"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,13 +1578,27 @@
},
"end": {
"line": 14,
"column": 27
"column": 28
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 300,
"start": 303,
"end": 326,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 27
}
},
"id": {
"type": "ObjectPattern",
"start": 303,
"end": 322,
"loc": {
"start": {
@ -1593,28 +1607,14 @@
},
"end": {
"line": 14,
"column": 26
}
},
"id": {
"type": "ObjectPattern",
"start": 300,
"end": 318,
"loc": {
"start": {
"line": 14,
"column": 4
},
"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"
},

View File

@ -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.

View File

@ -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,

View File

@ -1,2 +1,2 @@
let x: true;
let x: false;
let x1: true;
let x2: false;

View File

@ -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

View File

@ -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 };

View File

@ -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
}
}
}

View File

@ -0,0 +1 @@
import type, { imp } from "bar";

View File

@ -0,0 +1 @@
{ "plugins": ["transform-flow-strip-types", "syntax-class-properties"] }

View File

@ -0,0 +1 @@
import type, { imp } from "bar";

View File

@ -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>) => number) {}
function foo(): number{}
function foo():() => void {}
function foo():(_:bool) => number{}
function foo():(_?:bool) => number{}
function foo(): {} {}
function foo<T>() {}
function foo<T,S>() {}
a = function<T,S>() {};
a = { set fooProp(value: number) {} };
a = { set fooProp(value: number): void {} };
a = { get fooProp():number{} };
a = { id<T>(x: T): T {} };
a = { *id<T>(x: T): T {} };
a = { async id<T>(x: T): T {} };
a = { 123<T>(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>) => number) {}
function foo12(): number{}
function foo13():() => void {}
function foo14():(_:bool) => number{}
function foo15():(_?:bool) => number{}
function foo16(): {} {}
function foo17<T>() {}
function foo18<T,S>() {}
a1 = function<T,S>() {};
a2 = { set fooProp(value: number) {} };
a3 = { set fooProp(value: number): void {} };
a4 = { get fooProp():number{} };
a5 = { id<T>(x: T): T {} };
a6 = { *id<T>(x: T): T {} };
a7 = { async id<T>(x: T): T {} };
a8 = { 123<T>(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<string>): void };
var a: { id<T>(x: T): T; };
var a:Array<number> = [1, 2, 3]
a = class Foo<T> {}
a = class Foo<T> extends Bar<T> {}
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<string>): void };
var a13: { id<T>(x: T): T; };
var a14:Array<number> = [1, 2, 3]
a13 = class Foo<T> {}
a14 = class Foo<T> extends Bar<T> {}
class Foo4<T> {}
class Foo5<T> extends Bar<T> {}
class Foo6<T> extends mixin(Bar) {}
@ -60,7 +60,7 @@ class Foo7<T> {
class Foo8 {
"bar"<T>() {}
}
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<string> = [ "hello" ];
function foo({x}: { x: string; }) {}
function foo([x]: Array<string>) {}
function foo(...rest: Array<number>) {}
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<string> = [ "hello" ];
function foo20({x}: { x: string; }) {}
function foo21([x]: Array<string>) {}
function foo22(...rest: Array<number>) {}
(function (...rest: Array<number>) {});
((...rest: Array<number>) => rest);
var a: Map<string, Array<string> >
var a: Map<string, Array<string>>
var a: number[]
var a: ?string[]
var a: Promise<bool>[]
var a:(...rest:Array<number>) => number
var identity: <T>(x: T) => T
var identity: <T>(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<string, Array<string> >
var a16: Map<string, Array<string>>
var a17: number[]
var a18: ?string[]
var a19: Promise<bool>[]
var a20:(...rest:Array<number>) => number
var identity1: <T>(x: T) => T
var identity2: <T>(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<T> { p: T }
export interface int5 { p: number }
export interface int6<T> { p: T }
import 'foo';
export type * from "foo";

View File

@ -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';

View File

@ -65,7 +65,7 @@ describe("arrow function conversion", () => {
_supercall();
() => _supercall();
`,
{ methodName: "constructor" },
{ methodName: "constructor", extend: true },
);
});