Disallow usage of invalid keyword after export abstract statement in Typescript (#9336)

This commit is contained in:
Armano 2019-01-19 13:48:05 -08:00 committed by Brian Ng
parent 4ce37b7aca
commit a2e6d8e968
3 changed files with 12 additions and 1 deletions

View File

@ -1270,7 +1270,12 @@ export default (superClass: Class<Parser>): Class<Parser> =>
if (this.tsCheckLineTerminatorAndMatch(tt._class, next)) {
const cls: N.ClassDeclaration = node;
cls.abstract = true;
if (next) this.next();
if (next) {
this.next();
if (!this.match(tt._class)) {
this.unexpected(null, tt._class);
}
}
return this.parseClass(
cls,
/* isStatement */ true,

View File

@ -0,0 +1,3 @@
export abstract interface I {
}

View File

@ -0,0 +1,3 @@
{
"throws": "Unexpected token, expected \"class\" (1:16)"
}