| | |
| | | validate(defs.decorators, node, "decorators", decorators, 1); |
| | | return node; |
| | | } |
| | | function exportAllDeclaration(source) { |
| | | function exportAllDeclaration(source, attributes = null) { |
| | | const node = { |
| | | type: "ExportAllDeclaration", |
| | | source |
| | | source, |
| | | attributes |
| | | }; |
| | | const defs = NODE_FIELDS.ExportAllDeclaration; |
| | | validate(defs.source, node, "source", source, 1); |
| | | validate(defs.attributes, node, "attributes", attributes, 1); |
| | | return node; |
| | | } |
| | | function exportDefaultDeclaration(declaration) { |
| | |
| | | validate(defs.declaration, node, "declaration", declaration, 1); |
| | | return node; |
| | | } |
| | | function exportNamedDeclaration(declaration = null, specifiers = [], source = null) { |
| | | function exportNamedDeclaration(declaration = null, specifiers = [], source = null, attributes = null) { |
| | | const node = { |
| | | type: "ExportNamedDeclaration", |
| | | declaration, |
| | | specifiers, |
| | | source |
| | | source, |
| | | attributes |
| | | }; |
| | | const defs = NODE_FIELDS.ExportNamedDeclaration; |
| | | validate(defs.declaration, node, "declaration", declaration, 1); |
| | | validate(defs.specifiers, node, "specifiers", specifiers, 1); |
| | | validate(defs.source, node, "source", source, 1); |
| | | validate(defs.attributes, node, "attributes", attributes, 1); |
| | | return node; |
| | | } |
| | | function exportSpecifier(local, exported) { |
| | |
| | | validate(defs.await, node, "await", _await); |
| | | return node; |
| | | } |
| | | function importDeclaration(specifiers, source) { |
| | | function importDeclaration(specifiers, source, attributes = null) { |
| | | const node = { |
| | | type: "ImportDeclaration", |
| | | specifiers, |
| | | source |
| | | source, |
| | | attributes |
| | | }; |
| | | const defs = NODE_FIELDS.ImportDeclaration; |
| | | validate(defs.specifiers, node, "specifiers", specifiers, 1); |
| | | validate(defs.source, node, "source", source, 1); |
| | | validate(defs.attributes, node, "attributes", attributes, 1); |
| | | return node; |
| | | } |
| | | function importDefaultSpecifier(local) { |