Parse import-assertions (#12139)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com> Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -180,7 +180,19 @@ export function ImportDeclaration(node: Object) {
|
||||
|
||||
this.print(node.source, node);
|
||||
|
||||
if (node.attributes?.length) {
|
||||
if (node.assertions?.length) {
|
||||
this.space();
|
||||
this.word("assert");
|
||||
this.space();
|
||||
this.token("{");
|
||||
this.space();
|
||||
this.printList(node.assertions, node);
|
||||
this.space();
|
||||
this.token("}");
|
||||
}
|
||||
// todo(Babel 8): remove this if branch
|
||||
// `module-attributes` support is discontinued, use `import-assertions` instead.
|
||||
else if (node.attributes?.length) {
|
||||
this.space();
|
||||
this.word("with");
|
||||
this.space();
|
||||
|
||||
Reference in New Issue
Block a user