Preserve class helpers, template captures and pure export metadata - #3
Draft
yeargun wants to merge 4 commits into
Draft
Preserve class helpers, template captures and pure export metadata#3yeargun wants to merge 4 commits into
yeargun wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native public classes could strand private helpers inside a wrapper that the class emitter never creates. Large generated modules could also fail export validation when an earlier initializer called a function named
of. Release those helpers into an emitted scope and distinguish initializer expressions fromfor…ofdeclarations. Rejected export output is now available through the existing diagnostic dump option.Add opt-in
javascript.emit_pure_annotationsmetadata for calls bound to checked pure exports, preserving effectful arguments and excluding shadowed bindings. Motion can expose shared native controls and let downstream bundlers remove unused pure initialization without adding type validation at runtime.A second optimizer defect missed callback uses and captured stores inside template substitutions. Preserve those bindings in both token-based rewrites and the tree binding census. Copy propagation also retains assignments still read by nested closures. Regression tests cover shadowed template bindings and execute the original and rewritten JavaScript.
Validation: 1,635 compiler library tests pass, including native-constructor execution, annotation erasure, explicit type tests, export validation and purity-binding regressions. Motion's measured level-0 candidate passes 39 browser comparisons and 21 Node/package tests. Level 13 also passes all 39 browser checks after the fixes, but fails the narrow mini consumer size gate (24,306 raw bytes versus a 20,000-byte limit), so it is not selected for publication. This PR is based on the inherited-field fix in #2; broader release checks retain the baseline's existing failures.