Disallow usage of invalid keyword after export abstract statement in Typescript (#9336)
This commit is contained in:
parent
4ce37b7aca
commit
a2e6d8e968
@ -1270,7 +1270,12 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
if (this.tsCheckLineTerminatorAndMatch(tt._class, next)) {
|
if (this.tsCheckLineTerminatorAndMatch(tt._class, next)) {
|
||||||
const cls: N.ClassDeclaration = node;
|
const cls: N.ClassDeclaration = node;
|
||||||
cls.abstract = true;
|
cls.abstract = true;
|
||||||
if (next) this.next();
|
if (next) {
|
||||||
|
this.next();
|
||||||
|
if (!this.match(tt._class)) {
|
||||||
|
this.unexpected(null, tt._class);
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.parseClass(
|
return this.parseClass(
|
||||||
cls,
|
cls,
|
||||||
/* isStatement */ true,
|
/* isStatement */ true,
|
||||||
|
|||||||
3
packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/input.js
vendored
Normal file
3
packages/babel-parser/test/fixtures/typescript/interface/export-abstract-interface/input.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export abstract interface I {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"throws": "Unexpected token, expected \"class\" (1:16)"
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user