Skip to content

Turbopack: fix import_usage for functions behind member expressions#145

Merged
fireairforce merged 1 commit into
utoofrom
fix-inner-graph-member-call
May 6, 2026
Merged

Turbopack: fix import_usage for functions behind member expressions#145
fireairforce merged 1 commit into
utoofrom
fix-inner-graph-member-call

Conversation

@fireairforce
Copy link
Copy Markdown
Member

@fireairforce fireairforce commented May 6, 2026

align with: vercel#93504

just fix a runtime error from our business:

image

@fireairforce fireairforce merged commit bc888e2 into utoo May 6, 2026
14 of 27 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the ECMAScript analyzer's handling of member expressions to prevent identifier objects from being incorrectly added to the full star imports list. While the change correctly skips the general expression visitor for the object, it currently fails to visit the property of the member expression. Feedback suggests explicitly visiting the property to ensure identifiers or private names in that position are correctly analyzed.

// Skip traversing if obj is a Expr::Ident, so that it doesn't get added to
// Intentionally skipping over visit_expr(node.obj) here so that it doesn't get added to
// full_star_imports below in visit_expr.
ident.visit_with(self);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The visit_member_expr implementation skips node.prop when the condition is met. This means that identifiers or private names in the property position are not visited, which can lead to incorrect analysis (e.g., failing to mark them as used). You should explicitly visit node.prop.

Suggested change
ident.visit_with(self);
ident.visit_with(self);
node.prop.visit_with(self);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant