Skip to content

Commit ec339df

Browse files
robhoganfacebook-github-bot
authored andcommitted
Flow: Fix @babel/types libdef for getBindingIdentifiers (#57488)
Summary: The generated Flow libdef for `babel/types` declared `duplicates` as a required parameter on `getBindingIdentifiers` and `getOuterBindingIdentifiers`. It is actually optional, both at runtime (only read as a truthy flag, defaulting to the non-duplicate map) and in the upstream TS types: https://github.com/babel/babel/blob/7.x/packages/babel-types/src/retrievers/getBindingIdentifiers.ts#L17-L36 This prevented legitimate single-argument use later in this stack. Separating it for export to RN + Metro. Changelog: [Internal] Differential Revision: D111056985
1 parent d2ac190 commit ec339df

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

flow-typed/npm/babel-types_v7.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3848,8 +3848,8 @@ declare module "@babel/types" {
38483848
declare export function prependToMemberExpression(member: BabelNodeMemberExpression, prepend: BabelNodeExpression): BabelNodeMemberExpression
38493849
declare export function removeProperties<T>(n: T, opts: ?{}): void;
38503850
declare export function removePropertiesDeep<T>(n: T, opts: ?{}): T;
3851-
declare export function getBindingIdentifiers(node: BabelNode, duplicates: boolean, outerOnly?: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> }
3852-
declare export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> }
3851+
declare export function getBindingIdentifiers(node: BabelNode, duplicates?: boolean, outerOnly?: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> }
3852+
declare export function getOuterBindingIdentifiers(node: Node, duplicates?: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> }
38533853
declare export type TraversalAncestors = Array<{
38543854
node: BabelNode,
38553855
key: string,

0 commit comments

Comments
 (0)