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
2 changed files with 4 additions and 0 deletions

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"),