fix: disallow import assertionts in export without from (#12264)
This commit is contained in:
@@ -1906,6 +1906,10 @@ export default class StatementParser extends ExpressionParser {
|
||||
if (this.eatContextual("from")) {
|
||||
node.source = this.parseImportSource();
|
||||
this.checkExport(node);
|
||||
const assertions = this.maybeParseImportAssertions();
|
||||
if (assertions) {
|
||||
node.assertions = assertions;
|
||||
}
|
||||
} else {
|
||||
if (expect) {
|
||||
this.unexpected();
|
||||
@@ -1914,11 +1918,6 @@ export default class StatementParser extends ExpressionParser {
|
||||
}
|
||||
}
|
||||
|
||||
const assertions = this.maybeParseImportAssertions();
|
||||
if (assertions) {
|
||||
node.assertions = assertions;
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user