Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix exportKind declaration in babel-types #10126

Merged
merged 2 commits into from Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/babel-parser/src/types.js
Expand Up @@ -837,7 +837,7 @@ export type ExportNamedDeclaration = NodeBase & {
specifiers: $ReadOnlyArray<ExportSpecifier | ExportDefaultSpecifier>,
source: ?Literal,

exportKind?: "type" | "value", // TODO: Not in spec
exportKind?: "type" | "value" | "let", // TODO: Not in spec
};

export type ExportSpecifier = NodeBase & {
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-types/src/definitions/es2015.js
Expand Up @@ -5,6 +5,7 @@ import defineType, {
chain,
assertEach,
assertOneOf,
validateOptional,
} from "./utils";
import {
functionCommon,
Expand Down Expand Up @@ -260,6 +261,7 @@ defineType("ExportNamedDeclaration", {
validate: assertNodeType("StringLiteral"),
optional: true,
},
exportKind: validateOptional(assertOneOf("type", "value", "let")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is it let?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found it in astexplorer when trying:
export let something=1

but can not reproduce it now… - will remove it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should be a value export.

},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-types/src/definitions/flow.js
Expand Up @@ -150,7 +150,7 @@ defineType("DeclareExportAllDeclaration", {
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
source: validateType("StringLiteral"),
exportKind: validateOptional(assertOneOf(["type", "value"])),
exportKind: validateOptional(assertOneOf("type", "value")),
},
});

Expand Down