Skip to content

Conversation

@BlobMaster41
Copy link

Im so sorry about the removal of some " " but it was pissing me off so bad. My IDE keep removing the useless " " and its just annoying at this point. Theres only a few.

Refactored analyzeCapturedVariablesWithDeclared to remove the unused outerFunc parameter and updated its call sites. Improved closure environment setup logic, fixed minor code style issues, and removed redundant code. Also made minor whitespace and formatting adjustments throughout the file.

Refactored the merging of captures to remove redundant check for undefined captureIndex, as the value is always present when setting in existingCaptures.

Fixed the following warning:

INFO AS210: Expression is never 'null'.
:
8656 │ existingCaptures.set(local, captures.get(local)!);
│ ~~~~~~~~~~~~~~~~~~~
└─ in src/compiler.ts(8656,41)

Simplifies and streamlines the allocation of environment slots for captured locals and 'this' references by removing unnecessary variable assignments and directly assigning results. This improves code readability and reduces redundancy in the closure environment setup.
Refactored analyzeCapturedVariablesWithDeclared to remove the unused outerFunc parameter and updated its call sites. Improved closure environment setup logic, fixed minor code style issues, and removed redundant code. Also made minor whitespace and formatting adjustments throughout the file.

Simplify capture merging logic in Compiler

Refactored the merging of captures to remove redundant check for undefined captureIndex, as the value is always present when setting in existingCaptures.
@BlobMaster41 BlobMaster41 merged commit 16737cb into main Dec 12, 2025
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