fix(semantic): do not declare a Symbol for an ModuleDeclaration where the id is not a BindingIdentifier#10343
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 11, 2025
Conversation
Member
Author
CodSpeed Instrumentation Performance ReportMerging #10343 will not alter performanceComparing Summary
|
c21148f to
678454b
Compare
This was referenced Apr 10, 2025
Merged
678454b to
0a2fed4
Compare
This was referenced Apr 11, 2025
id is not a BindingIdentifierSymbol for an ModuleDeclaration where the id is not a BindingIdentifier
This was referenced Apr 11, 2025
0a2fed4 to
d4bcd57
Compare
Contributor
Merge activity
|
…here the `id` is not a `BindingIdentifier` (#10343) In previous implementations, a symbol was declared for `ModuleDeclaration` but only inserted when `name` was a `BindingIdentifier`. This is incorrect and also causes a potential performance impact. See https://github.com/oxc-project/oxc/blob/bae53b9606b62fce58b4101497849997b0dc07b3/crates/oxc_semantic/src/stats.rs. So we should only declare a symbol when its name is a `BindingIdentifier` because only `BindingIdentifier` can be inserted with a symbol ID.
d4bcd57 to
c37f048
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In previous implementations, a symbol was declared for
ModuleDeclarationbut only inserted whennamewas aBindingIdentifier. This is incorrect and also causes a potential performance impact. See https://github.com/oxc-project/oxc/blob/bae53b9606b62fce58b4101497849997b0dc07b3/crates/oxc_semantic/src/stats.rs.So we should only declare a symbol when its name is a
BindingIdentifierbecause onlyBindingIdentifiercan be inserted with a symbol ID.