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
84 changed files with 4635 additions and 4583 deletions

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,5 +1,5 @@
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,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"
},

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,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"
},

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