Skip to content

Preserve inherited callbacks and field ranges in optimized output - #2

Draft
yeargun wants to merge 1 commit into
fix/public-class-defaultsfrom
fix/inherited-field-analysis
Draft

Preserve inherited callbacks and field ranges in optimized output#2
yeargun wants to merge 1 commit into
fix/public-class-defaultsfrom
fix/inherited-field-analysis

Conversation

@yeargun

@yeargun yeargun commented Sep 11, 2026

Copy link
Copy Markdown
Owner

An inherited field was analysed separately under each class name. When a base constructor stored null and a subclass installed an animation callback, the optimizer could remove the callback branch and emit the base fallback. Motionlil's native animation interruption exposed this: stopping an animation committed the wrong value.

The analysis now shares field facts across the inheritance hierarchy, including defaults, writes and untyped boundaries. Integer ranges use the same storage identity so overflow coercions remain valid. A runtime regression covers callbacks, string fields, integer overflow and three levels of inheritance, with inlining both enabled and disabled.

Validation: all 1,626 library tests pass; the minimal emitted-JavaScript reproduction returns 42 for the subclass; 37 Motion browser checks pass against the pinned source-built original, including interruption, easing, controls and RAF scheduling. This targets fix/public-class-defaults; the current Motion source build is pinned to this branch’s compiler commit.

GitHub CI also passes all 1,626 library tests. The broader workflow still fails on formatting already present in the base and the unchanged interpreter-based differential-generator test (14 lines, expected 11).

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