Skip to content

Commit

Permalink
Fix Flow error
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Dec 6, 2019
1 parent fd1b6a5 commit 2bcbc0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/babel-parser/src/plugins/estree.js
Expand Up @@ -397,10 +397,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
}

finishCallExpression<T: N.CallExpression | N.OptionalCallExpression>(
node: T,
optional: boolean,
): T & { source?: N.Node } {
finishCallExpression<
T: N.CallExpression | N.OptionalCallExpression | N.EstreeImportExpression,
>(node: T, optional: boolean): T {
const finishedNode = super.finishCallExpression(node, optional);

if (node.callee.type === "Import") {
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-parser/src/types.js
Expand Up @@ -1012,7 +1012,7 @@ export type FlowInterfaceType = NodeBase & {
body: FlowObjectTypeAnnotation,
};

// estree
// ESTree

export type EstreeProperty = NodeBase & {
type: "Property",
Expand All @@ -1038,6 +1038,11 @@ export type EstreeMethodDefinition = NodeBase & {
variance?: ?FlowVariance,
};

export type EstreeImportExpression = CallExpression & {
type: "ImportExpression",
source: Node,
};

// === === === ===
// TypeScript
// === === === ===
Expand Down

0 comments on commit 2bcbc0c

Please sign in to comment.