Skip to content

docs(semantic): document with statement limitation in is_global_reference#17996

Merged
Boshen merged 1 commit intomainfrom
docs/is-global-reference-with-statement
Jan 14, 2026
Merged

docs(semantic): document with statement limitation in is_global_reference#17996
Boshen merged 1 commit intomainfrom
docs/is-global-reference-with-statement

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jan 14, 2026

Summary

Documents the limitation that is_global_reference does not correctly handle references inside with statements, as discussed in #8365.

The documentation explains:

  • The limitation where is_global_reference incorrectly returns true for references inside with blocks
  • A code example illustrating the issue
  • Why this limitation is acceptable (strict mode forbids with, bundlers don't support it, minifier bails out)

Closes #8365

Test plan

  • Documentation only change, no functional changes

🤖 Generated with Claude Code

…ference`

Closes #8365

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Boshen Boshen requested a review from Dunqing as a code owner January 14, 2026 12:43
Copilot AI review requested due to automatic review settings January 14, 2026 12:43
@github-actions github-actions bot added A-semantic Area - Semantic C-docs Category - Documentation. Related to user-facing or internal documentation labels Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds documentation to the is_global_reference function to explain a known limitation with with statements. The documentation clarifies that the function incorrectly returns true for references inside with blocks that may actually resolve to properties of the with object at runtime.

Changes:

  • Fixed grammar: "a identifier" → "an identifier"
  • Added comprehensive documentation section explaining the with statement limitation
  • Included a code example demonstrating the issue
  • Provided justification for why this limitation is acceptable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 14, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing docs/is-global-reference-with-statement (17523eb) with main (e7631dd)

Summary

✅ 42 untouched benchmarks
⏩ 3 skipped benchmarks1

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen merged commit 06a96da into main Jan 14, 2026
34 checks passed
@Boshen Boshen deleted the docs/is-global-reference-with-statement branch January 14, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

semantics: scopes for with statements are not created (Object Environment Record)

2 participants