Skip to content

Use const for hand-written iterator objects in 00generator.ts#247

Merged
ASDAlexander77 merged 1 commit into
mainfrom
cleanup-stale-const-comment-00generator
Jul 18, 2026
Merged

Use const for hand-written iterator objects in 00generator.ts#247
ASDAlexander77 merged 1 commit into
mainfrom
cleanup-stale-const-comment-00generator

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

  • The // DO NOT PUT CONST, otherwise you can't edit comments in 00generator.ts (main1/main2/main3) dated back to the bug fixed in Give const bindings with bound-method fields (generators) real identity storage #244: a const binding with no backing storage couldn't correctly mutate an object's state through a bound method (like .next() mutating this.nextIndex/this.iterationCount).
  • That's fixed. Verified const bindings to these hand-written iterator objects now advance state correctly across manual .next() calls. Switched let itconst it in all three main* functions and removed the stale comments — it is never reassigned in any of them anyway.
  • Scanned the rest of the test suite for similar stale "don't use const" style comments; this was the only file with this pattern.

Test plan

  • 00generator.ts (compile + JIT) passes with const iterator bindings
  • Full suite: 351/351 JIT + 355/355 compile, 0 failures

🤖 Generated with Claude Code

@ASDAlexander77
ASDAlexander77 merged commit 172e013 into main Jul 18, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the cleanup-stale-const-comment-00generator branch July 18, 2026 16:26
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