Skip to content

Remove dead LoadVariable method from AsyncArrowMoveNextEmitter#706

Merged
nickna merged 1 commit into
mainfrom
wrk/romantic-mayer-2e10b3
Jun 16, 2026
Merged

Remove dead LoadVariable method from AsyncArrowMoveNextEmitter#706
nickna merged 1 commit into
mainfrom
wrk/romantic-mayer-2e10b3

Conversation

@nickna

@nickna nickna commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Deletes the unused LoadVariable(string) method from
Compilation/AsyncArrowMoveNextEmitter.Variables.cs and fixes the two
comments that referenced it by name.

Why

A repo-wide search confirms LoadVariable had no callers. The only live
variable-load paths in this emitter are:

  • the EmitVariable override (general expression loads), and
  • LoadVariableForCapture (capture population, called from
    AsyncArrowMoveNextEmitter.ArrowFunctions.cs).

LoadVariable was a leftover near-duplicate of EmitVariable. It was also a
latent copy of the bug fixed in #648 / PR #671: like the pre-fix
EmitVariable, its Ldnull fallback never consulted the JS global constants
(NaN/Infinity/undefined). Had it ever been wired up, a bare
NaN/Infinity would again have compiled to a null load (e.g. NaN === NaN
degrading to null === nulltrue). Removing it eliminates that trap rather
than leaving a second code path that would need the same fix.

Changes

  • Remove the dead LoadVariable method (~82 lines).
  • Update its two now-dangling doc/inline comment references to point at the
    live EmitVariable override / capture-population loader instead.

Reviewer notes

`LoadVariable(string)` in AsyncArrowMoveNextEmitter.Variables.cs had no
callers. The only live variable-load paths in this emitter are the
`EmitVariable` override and `LoadVariableForCapture` (used by
ArrowFunctions.cs); `LoadVariable` was a near-duplicate of `EmitVariable`
left behind.

It was also a latent copy of the bug fixed in #648 / PR #671: like the
pre-fix `EmitVariable`, its `Ldnull` fallback never consulted the JS
global constants (NaN/Infinity/undefined), so had it ever been wired up a
bare `NaN`/`Infinity` would again compile to a null load.

Delete the dead method and update the two comments that referenced it by
name so they point at the live `EmitVariable` override / capture-population
loader instead.

No behavioral change. Build clean; AsyncNaNStrictEqualityTests 20/20 green.
@nickna nickna merged commit a31d022 into main Jun 16, 2026
3 checks passed
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