Move tests from babylon/ to babel-parserr/
This commit is contained in:
11
packages/babel-parser/test/fixtures/flow/proto-props/declare-class/input.js
vendored
Normal file
11
packages/babel-parser/test/fixtures/flow/proto-props/declare-class/input.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
declare class A {
|
||||
proto: T;
|
||||
}
|
||||
|
||||
declare class B {
|
||||
proto x: T;
|
||||
}
|
||||
|
||||
declare class C {
|
||||
proto +x: T;
|
||||
}
|
||||
434
packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json
vendored
Normal file
434
packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json
vendored
Normal file
@@ -0,0 +1,434 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 102,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 11,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 102,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 11,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "DeclareClass",
|
||||
"start": 0,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 14,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"identifierName": "A"
|
||||
},
|
||||
"name": "A"
|
||||
},
|
||||
"typeParameters": null,
|
||||
"extends": [],
|
||||
"implements": [],
|
||||
"mixins": [],
|
||||
"body": {
|
||||
"type": "ObjectTypeAnnotation",
|
||||
"start": 16,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"callProperties": [],
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectTypeProperty",
|
||||
"start": 20,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "proto"
|
||||
},
|
||||
"name": "proto"
|
||||
},
|
||||
"static": false,
|
||||
"proto": false,
|
||||
"kind": "init",
|
||||
"method": false,
|
||||
"value": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 27,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
},
|
||||
"identifierName": "T"
|
||||
},
|
||||
"name": "T"
|
||||
}
|
||||
},
|
||||
"variance": null,
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"indexers": [],
|
||||
"internalSlots": [],
|
||||
"exact": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "DeclareClass",
|
||||
"start": 33,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 47,
|
||||
"end": 48,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 15
|
||||
},
|
||||
"identifierName": "B"
|
||||
},
|
||||
"name": "B"
|
||||
},
|
||||
"typeParameters": null,
|
||||
"extends": [],
|
||||
"implements": [],
|
||||
"mixins": [],
|
||||
"body": {
|
||||
"type": "ObjectTypeAnnotation",
|
||||
"start": 49,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"callProperties": [],
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectTypeProperty",
|
||||
"start": 53,
|
||||
"end": 63,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 59,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"static": false,
|
||||
"proto": true,
|
||||
"kind": "init",
|
||||
"method": false,
|
||||
"value": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 62,
|
||||
"end": 63,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 62,
|
||||
"end": 63,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 12
|
||||
},
|
||||
"identifierName": "T"
|
||||
},
|
||||
"name": "T"
|
||||
}
|
||||
},
|
||||
"variance": null,
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"indexers": [],
|
||||
"internalSlots": [],
|
||||
"exact": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "DeclareClass",
|
||||
"start": 68,
|
||||
"end": 102,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 11,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 82,
|
||||
"end": 83,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 15
|
||||
},
|
||||
"identifierName": "C"
|
||||
},
|
||||
"name": "C"
|
||||
},
|
||||
"typeParameters": null,
|
||||
"extends": [],
|
||||
"implements": [],
|
||||
"mixins": [],
|
||||
"body": {
|
||||
"type": "ObjectTypeAnnotation",
|
||||
"start": 84,
|
||||
"end": 102,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 11,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"callProperties": [],
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectTypeProperty",
|
||||
"start": 88,
|
||||
"end": 99,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 10,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 95,
|
||||
"end": 96,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 10,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 10
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"static": false,
|
||||
"proto": true,
|
||||
"kind": "init",
|
||||
"method": false,
|
||||
"value": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 98,
|
||||
"end": 99,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 10,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 98,
|
||||
"end": 99,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 10,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "T"
|
||||
},
|
||||
"name": "T"
|
||||
}
|
||||
},
|
||||
"variance": {
|
||||
"type": "Variance",
|
||||
"start": 94,
|
||||
"end": 95,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 10,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"kind": "plus"
|
||||
},
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"indexers": [],
|
||||
"internalSlots": [],
|
||||
"exact": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/interface/input.js
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/interface/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
interface I {
|
||||
proto p: string;
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/interface/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/interface/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token, expected \":\" (2:8)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/flow/proto-props/object/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/proto-props/object/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
type T = { proto p: string }
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/object/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/object/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token, expected \":\" (1:17)"
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/proto-static/input.js
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/proto-static/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare class C {
|
||||
proto static p: T;
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/proto-static/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/proto-static/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token, expected \":\" (2:15)"
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/static-proto/input.js
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/static-proto/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare class C {
|
||||
static proto p: T;
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/flow/proto-props/static-proto/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/proto-props/static-proto/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token, expected \":\" (2:15)"
|
||||
}
|
||||
Reference in New Issue
Block a user