Support Import Assertions for re-export statement (#12249)
This commit is contained in:
@@ -1924,6 +1924,11 @@ export default class StatementParser extends ExpressionParser {
|
||||
}
|
||||
}
|
||||
|
||||
const assertions = this.maybeParseImportAssertions();
|
||||
if (assertions) {
|
||||
node.assertions = assertions;
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
|
||||
@@ -360,6 +360,12 @@ export type Directive = NodeBase & {
|
||||
|
||||
export type DirectiveLiteral = StringLiteral & { type: "DirectiveLiteral" };
|
||||
|
||||
export type ImportAttribute = NodeBase & {
|
||||
type: "ImportAttribute",
|
||||
key: Identifier | StringLiteral,
|
||||
value: StringLiteral,
|
||||
};
|
||||
|
||||
// Expressions
|
||||
|
||||
export type Super = NodeBase & { type: "Super" };
|
||||
@@ -867,6 +873,8 @@ export type ExportNamedDeclaration = NodeBase & {
|
||||
source: ?Literal,
|
||||
|
||||
exportKind?: "type" | "value", // TODO: Not in spec
|
||||
|
||||
assertions?: $ReadOnlyArray<ImportAttribute>,
|
||||
};
|
||||
|
||||
export type ExportSpecifier = NodeBase & {
|
||||
|
||||
Reference in New Issue
Block a user