Skip to content

Commit

Permalink
Make assertions optional and update AST spec (#12280)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Oct 29, 2020
1 parent f5f9f51 commit ff6c379
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-parser/ast/spec.md
Expand Up @@ -1412,6 +1412,7 @@ An export default declaration, e.g., `export default function () {};` or `export
interface ExportAllDeclaration <: ModuleDeclaration {
type: "ExportAllDeclaration";
source: StringLiteral;
assertions?: [ ImportAttribute ];
}
```

Expand Down
3 changes: 3 additions & 0 deletions packages/babel-types/src/definitions/core.js
Expand Up @@ -1402,6 +1402,7 @@ defineType("ExportAllDeclaration", {
validate: assertNodeType("StringLiteral"),
},
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),
Expand Down Expand Up @@ -1471,6 +1472,7 @@ defineType("ExportNamedDeclaration", {
),
},
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),
Expand Down Expand Up @@ -1572,6 +1574,7 @@ defineType("ImportDeclaration", {
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
fields: {
assertions: {
optional: true,
validate: chain(
assertValueType("array"),
assertNodeType("ImportAttribute"),
Expand Down

0 comments on commit ff6c379

Please sign in to comment.