Throw error if TypeScript class has empty implements (#9292)
This commit is contained in:
2
packages/babel-parser/test/fixtures/typescript/class/extends-empty/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/typescript/class/extends-empty/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
interface foo extends {
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "'extends' list cannot be empty. (1:22)"
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
class Foo extends Bar implements {
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "'implements' list cannot be empty. (1:33)"
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/typescript/class/implements-empty/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/typescript/class/implements-empty/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
class Foo implements {
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "'implements' list cannot be empty. (1:21)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/typescript/type-arguments/empty/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/typescript/type-arguments/empty/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
foo<>()
|
||||
99
packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json
vendored
Normal file
99
packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "CallExpression",
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"arguments": [],
|
||||
"typeParameters": {
|
||||
"type": "TSTypeParameterInstantiation",
|
||||
"start": 3,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"params": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user