Visitar URL original
feat: add `isReferenceIdentifier` and `isOnlyBindingIdentifier` by cernymatej · Pull Request #344 · oxc-project/oxc-walker · GitHub
Skip to content

feat: add isReferenceIdentifier and isOnlyBindingIdentifier - #344

Merged
danielroe merged 8 commits into
oxc-project:mainfrom
cernymatej:feat/is-reference-identifier
Jul 30, 2026
Merged

danielroe merged 8 commits into
oxc-project:mainfrom
cernymatej:feat/is-reference-identifier

Conversation

@cernymatej

@cernymatej cernymatej commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

while investigating nuxt/nuxt#35858, I noticed that we have some gaps in oxc-walker and that there are some incorrect assumptions in isBindingIdentifier.

we often used !isBindingIdentifier() to identify reference identifiers, which was incorrect in several cases.
this PR adds a new function isReferenceIdentifier, isOnlyBindingIdentifier which behaves consistently with its name, and deprecates the old incorrect isBindingIdentifier

additionally, there is also a new mode?: 'value' | 'type' | 'all' option in the relevant ScopeTracker methods to target either runtime identifiers, type identifiers, or both.

@codecov-commenter

codecov-commenter commented Jul 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.45%. Comparing base (e42817e) to head (ebb0201).

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #344       +/-   ##
===========================================
+ Coverage   86.75%   99.45%   +12.70%     
===========================================
  Files           5        5               
  Lines         400      547      +147     
  Branches      115      207       +92     
===========================================
+ Hits          347      544      +197     
+ Misses         53        3       -50     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cernymatej
cernymatej force-pushed the feat/is-reference-identifier branch from ddffeed to b53a9e9 Compare July 29, 2026 07:17
@cernymatej
cernymatej force-pushed the feat/is-reference-identifier branch from b53a9e9 to 5bcd282 Compare July 29, 2026 08:30
@cernymatej
cernymatej marked this pull request as ready for review July 29, 2026 09:17
@cernymatej cernymatej changed the title feat!: add isReferenceIdentifier and restrict isBindingIdentifier to binding positions feat: add isReferenceIdentifier and isOnlyBindingIdentifier Jul 29, 2026
@cernymatej
cernymatej force-pushed the feat/is-reference-identifier branch from 4d4a7b4 to 8dc8682 Compare July 29, 2026 11:31
@danielroe
danielroe merged commit ee083fa into oxc-project:main Jul 30, 2026
4 checks passed
@oxc-guard oxc-guard Bot mentioned this pull request Jul 30, 2026
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.

3 participants