Skip to content

Scopes: Handle *null* for original variable names#244

Open
szuend wants to merge 2 commits into
tc39:proposal-scopesfrom
szuend:fix-todo
Open

Scopes: Handle *null* for original variable names#244
szuend wants to merge 2 commits into
tc39:proposal-scopesfrom
szuend:fix-todo

Conversation

@szuend
Copy link
Copy Markdown
Collaborator

@szuend szuend commented Mar 3, 2026

This PR turns a broken "names" index into an empty string. We need to preserve the length of the array so bindings can be matched. We can't just filter out broken indices.

The alternatives are:

  • Type "Variables" in the original scope as (string | null)[] instead of just as string[]. This feels wrong though.
  • Unconditionally report an error and abort decoding. This feels overly restrictive though.

Drive-by: FIx a typo and use ~none~ consistently.

@szuend szuend requested review from jridgewell and takikawa March 3, 2026 08:40
Comment thread spec.emu Outdated
Copy link
Copy Markdown
Collaborator

@takikawa takikawa left a comment

Choose a reason for hiding this comment

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

LGTM aside from the one comment

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.

2 participants