Make assertions optional and update AST spec (#12280)

This commit is contained in:
Sosuke Suzuki 2020-10-30 00:21:52 +09:00 committed by GitHub
parent f5f9f51b5e
commit ff6c3792bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -1412,6 +1412,7 @@ An export default declaration, e.g., `export default function () {};` or `export
interface ExportAllDeclaration <: ModuleDeclaration {
type: "ExportAllDeclaration";
source: StringLiteral;
assertions?: [ ImportAttribute ];
}
```

View File

@ -1402,6 +1402,7 @@ defineType("ExportAllDeclaration", {
validate: assertNodeType("StringLiteral"),
},
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),
@ -1471,6 +1472,7 @@ defineType("ExportNamedDeclaration", {
),
},
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),
@ -1572,6 +1574,7 @@ defineType("ImportDeclaration", {
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
fields: {
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),