add AST for the module attribute proposal (#11015)
Introduce a `ImportAttribute` structure and add an `attributes` key on the `ImportDeclaration` node. [skip ci]
This commit is contained in:
parent
45301c5304
commit
34a9653281
@ -107,6 +107,7 @@ These are the core @babel/parser (babylon) AST node types.
|
|||||||
- [ImportSpecifier](#importspecifier)
|
- [ImportSpecifier](#importspecifier)
|
||||||
- [ImportDefaultSpecifier](#importdefaultspecifier)
|
- [ImportDefaultSpecifier](#importdefaultspecifier)
|
||||||
- [ImportNamespaceSpecifier](#importnamespacespecifier)
|
- [ImportNamespaceSpecifier](#importnamespacespecifier)
|
||||||
|
- [ImportAttribute](#importattribute)
|
||||||
- [Exports](#exports)
|
- [Exports](#exports)
|
||||||
- [ExportNamedDeclaration](#exportnameddeclaration)
|
- [ExportNamedDeclaration](#exportnameddeclaration)
|
||||||
- [ExportSpecifier](#exportspecifier)
|
- [ExportSpecifier](#exportspecifier)
|
||||||
@ -1221,6 +1222,7 @@ interface ImportDeclaration <: ModuleDeclaration {
|
|||||||
importKind: null | "type" | "typeof" | "value";
|
importKind: null | "type" | "typeof" | "value";
|
||||||
specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ];
|
specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ];
|
||||||
source: Literal;
|
source: Literal;
|
||||||
|
attributes?: [ ImportAttribute ];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1259,6 +1261,18 @@ interface ImportNamespaceSpecifier <: ModuleSpecifier {
|
|||||||
|
|
||||||
A namespace import specifier, e.g., `* as foo` in `import * as foo from "mod.js"`.
|
A namespace import specifier, e.g., `* as foo` in `import * as foo from "mod.js"`.
|
||||||
|
|
||||||
|
### ImportAttribute
|
||||||
|
|
||||||
|
```js
|
||||||
|
interface ImportAttribute <: Node {
|
||||||
|
type: "ImportAttribute";
|
||||||
|
key: Identifier;
|
||||||
|
value: StringLiteral;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
An attribute specified on the ImportDeclaration.
|
||||||
|
|
||||||
## Exports
|
## Exports
|
||||||
|
|
||||||
### ExportNamedDeclaration
|
### ExportNamedDeclaration
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user