switch babylon tests to fixtures

This commit is contained in:
Sebastian McKenzie
2015-07-25 05:19:32 +01:00
parent 008f3d6ada
commit 14d2625753
2566 changed files with 88445 additions and 62884 deletions

View File

@@ -0,0 +1 @@
interface A {}

View File

@@ -0,0 +1,62 @@
{
"type": "Program",
"body": [
{
"type": "InterfaceDeclaration",
"id": {
"type": "Identifier",
"name": "A",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"typeParameters": null,
"body": {
"type": "ObjectTypeAnnotation",
"properties": [],
"indexers": [],
"callProperties": [],
"range": [
12,
14
],
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
}
},
"extends": [],
"range": [
0,
14
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
}
}
]
}

View File

@@ -0,0 +1 @@
interface A extends B {}

View File

@@ -0,0 +1,99 @@
{
"type": "Program",
"body": [
{
"type": "InterfaceDeclaration",
"id": {
"type": "Identifier",
"name": "A",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"typeParameters": null,
"body": {
"type": "ObjectTypeAnnotation",
"properties": [],
"indexers": [],
"callProperties": [],
"range": [
22,
24
],
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 24
}
}
},
"extends": [
{
"type": "InterfaceExtends",
"id": {
"type": "Identifier",
"name": "B",
"range": [
20,
21
],
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 21
}
}
},
"typeParameters": null,
"range": [
20,
21
],
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 21
}
}
}
],
"range": [
0,
24
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
}
}
]
}

View File

@@ -0,0 +1 @@
interface A<T> extends B<T>, C<T> {}

View File

@@ -0,0 +1,279 @@
{
"type": "Program",
"body": [
{
"type": "InterfaceDeclaration",
"id": {
"type": "Identifier",
"name": "A",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"typeParameters": {
"type": "TypeParameterDeclaration",
"params": [
{
"type": "Identifier",
"name": "T",
"range": [
12,
13
],
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 13
}
}
}
],
"range": [
11,
14
],
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 14
}
}
},
"body": {
"type": "ObjectTypeAnnotation",
"properties": [],
"indexers": [],
"callProperties": [],
"range": [
34,
36
],
"loc": {
"start": {
"line": 1,
"column": 34
},
"end": {
"line": 1,
"column": 36
}
}
},
"extends": [
{
"type": "InterfaceExtends",
"id": {
"type": "Identifier",
"name": "B",
"range": [
23,
24
],
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 24
}
}
},
"typeParameters": {
"type": "TypeParameterInstantiation",
"params": [
{
"type": "GenericTypeAnnotation",
"id": {
"type": "Identifier",
"name": "T",
"range": [
25,
26
],
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 26
}
}
},
"typeParameters": null,
"range": [
25,
26
],
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 26
}
}
}
],
"range": [
24,
27
],
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 27
}
}
},
"range": [
23,
27
],
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 27
}
}
},
{
"type": "InterfaceExtends",
"id": {
"type": "Identifier",
"name": "C",
"range": [
29,
30
],
"loc": {
"start": {
"line": 1,
"column": 29
},
"end": {
"line": 1,
"column": 30
}
}
},
"typeParameters": {
"type": "TypeParameterInstantiation",
"params": [
{
"type": "GenericTypeAnnotation",
"id": {
"type": "Identifier",
"name": "T",
"range": [
31,
32
],
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 32
}
}
},
"typeParameters": null,
"range": [
31,
32
],
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 32
}
}
}
],
"range": [
30,
33
],
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 33
}
}
},
"range": [
29,
33
],
"loc": {
"start": {
"line": 1,
"column": 29
},
"end": {
"line": 1,
"column": 33
}
}
}
],
"range": [
0,
36
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
}
}
]
}

View File

@@ -0,0 +1 @@
interface A { foo: () => number; }

View File

@@ -0,0 +1,135 @@
{
"type": "Program",
"body": [
{
"type": "InterfaceDeclaration",
"id": {
"type": "Identifier",
"name": "A",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"typeParameters": null,
"body": {
"type": "ObjectTypeAnnotation",
"properties": [
{
"type": "ObjectTypeProperty",
"key": {
"type": "Identifier",
"name": "foo",
"range": [
14,
17
],
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 17
}
}
},
"value": {
"type": "FunctionTypeAnnotation",
"params": [],
"returnType": {
"type": "NumberTypeAnnotation",
"range": [
25,
31
],
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 31
}
}
},
"typeParameters": null,
"range": [
19,
31
],
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 31
}
}
},
"optional": false,
"range": [
14,
32
],
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 32
}
}
}
],
"indexers": [],
"callProperties": [],
"range": [
12,
34
],
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 34
}
}
},
"extends": [],
"range": [
0,
34
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
}
}
]
}

View File

@@ -0,0 +1 @@
interface Dictionary { [index: string]: string; length: number; }

View File

@@ -0,0 +1,186 @@
{
"type": "Program",
"body": [
{
"type": "InterfaceDeclaration",
"id": {
"type": "Identifier",
"name": "Dictionary",
"range": [
10,
20
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 20
}
}
},
"typeParameters": null,
"body": {
"type": "ObjectTypeAnnotation",
"properties": [
{
"type": "ObjectTypeProperty",
"key": {
"type": "Identifier",
"name": "length",
"range": [
48,
54
],
"loc": {
"start": {
"line": 1,
"column": 48
},
"end": {
"line": 1,
"column": 54
}
}
},
"value": {
"type": "NumberTypeAnnotation",
"range": [
56,
62
],
"loc": {
"start": {
"line": 1,
"column": 56
},
"end": {
"line": 1,
"column": 62
}
}
},
"optional": false,
"range": [
48,
63
],
"loc": {
"start": {
"line": 1,
"column": 48
},
"end": {
"line": 1,
"column": 63
}
}
}
],
"indexers": [
{
"type": "ObjectTypeIndexer",
"id": {
"type": "Identifier",
"name": "index",
"range": [
24,
29
],
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 29
}
}
},
"key": {
"type": "StringTypeAnnotation",
"range": [
31,
37
],
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 37
}
}
},
"value": {
"type": "StringTypeAnnotation",
"range": [
40,
46
],
"loc": {
"start": {
"line": 1,
"column": 40
},
"end": {
"line": 1,
"column": 46
}
}
},
"range": [
23,
47
],
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 47
}
}
}
],
"callProperties": [],
"range": [
21,
65
],
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 65
}
}
},
"extends": [],
"range": [
0,
65
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 65
}
}
}
]
}

View File

@@ -0,0 +1 @@
class Foo implements Bar {}

View File

@@ -0,0 +1,97 @@
{
"type": "Program",
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [],
"range": [
25,
27
],
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 27
}
}
},
"implements": [
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Bar",
"range": [
21,
24
],
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
}
},
"typeParameters": null,
"range": [
21,
24
],
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
}
}
],
"range": [
0,
27
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 27
}
}
}
]
}

View File

@@ -0,0 +1 @@
class Foo extends Bar implements Bat, Man<number> {}

View File

@@ -0,0 +1,185 @@
{
"type": "Program",
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
},
"superClass": {
"type": "Identifier",
"name": "Bar",
"range": [
18,
21
],
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 21
}
}
},
"body": {
"type": "ClassBody",
"body": [],
"range": [
50,
52
],
"loc": {
"start": {
"line": 1,
"column": 50
},
"end": {
"line": 1,
"column": 52
}
}
},
"implements": [
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Bat",
"range": [
33,
36
],
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 36
}
}
},
"typeParameters": null,
"range": [
33,
36
],
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 36
}
}
},
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Man",
"range": [
38,
41
],
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 41
}
}
},
"typeParameters": {
"type": "TypeParameterInstantiation",
"params": [
{
"type": "NumberTypeAnnotation",
"range": [
42,
48
],
"loc": {
"start": {
"line": 1,
"column": 42
},
"end": {
"line": 1,
"column": 48
}
}
}
],
"range": [
41,
49
],
"loc": {
"start": {
"line": 1,
"column": 41
},
"end": {
"line": 1,
"column": 49
}
}
},
"range": [
38,
49
],
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 49
}
}
}
],
"range": [
0,
52
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
}
}
]
}

View File

@@ -0,0 +1 @@
class Foo extends class Bar implements Bat {} {}

View File

@@ -0,0 +1,150 @@
{
"type": "Program",
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
},
"superClass": {
"type": "ClassExpression",
"id": {
"type": "Identifier",
"name": "Bar",
"range": [
24,
27
],
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 27
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [],
"range": [
43,
45
],
"loc": {
"start": {
"line": 1,
"column": 43
},
"end": {
"line": 1,
"column": 45
}
}
},
"implements": [
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Bat",
"range": [
39,
42
],
"loc": {
"start": {
"line": 1,
"column": 39
},
"end": {
"line": 1,
"column": 42
}
}
},
"typeParameters": null,
"range": [
39,
42
],
"loc": {
"start": {
"line": 1,
"column": 39
},
"end": {
"line": 1,
"column": 42
}
}
}
],
"range": [
18,
45
],
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 45
}
}
},
"body": {
"type": "ClassBody",
"body": [],
"range": [
46,
48
],
"loc": {
"start": {
"line": 1,
"column": 46
},
"end": {
"line": 1,
"column": 48
}
}
},
"range": [
0,
48
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 48
}
}
}
]
}

View File

@@ -0,0 +1 @@
class Foo extends class Bar implements Bat {} implements Man {}

View File

@@ -0,0 +1,188 @@
{
"type": "Program",
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo",
"range": [
6,
9
],
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
}
},
"superClass": {
"type": "ClassExpression",
"id": {
"type": "Identifier",
"name": "Bar",
"range": [
24,
27
],
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 27
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [],
"range": [
43,
45
],
"loc": {
"start": {
"line": 1,
"column": 43
},
"end": {
"line": 1,
"column": 45
}
}
},
"implements": [
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Bat",
"range": [
39,
42
],
"loc": {
"start": {
"line": 1,
"column": 39
},
"end": {
"line": 1,
"column": 42
}
}
},
"typeParameters": null,
"range": [
39,
42
],
"loc": {
"start": {
"line": 1,
"column": 39
},
"end": {
"line": 1,
"column": 42
}
}
}
],
"range": [
18,
45
],
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 45
}
}
},
"body": {
"type": "ClassBody",
"body": [],
"range": [
61,
63
],
"loc": {
"start": {
"line": 1,
"column": 61
},
"end": {
"line": 1,
"column": 63
}
}
},
"implements": [
{
"type": "ClassImplements",
"id": {
"type": "Identifier",
"name": "Man",
"range": [
57,
60
],
"loc": {
"start": {
"line": 1,
"column": 57
},
"end": {
"line": 1,
"column": 60
}
}
},
"typeParameters": null,
"range": [
57,
60
],
"loc": {
"start": {
"line": 1,
"column": 57
},
"end": {
"line": 1,
"column": 60
}
}
}
],
"range": [
0,
63
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 63
}
}
}
]
}