fix: annotate asm.js integer return type - #230
Open
Justineo wants to merge 1 commit into
Open
Conversation
Justineo
marked this pull request as ready for review
August 2, 2026 15:17
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.
AI disclosure — Codex, GPT-5.6 Sol (Extra High)
This PR was researched, implemented, tested, and drafted by Codex. I provided the requirements, requested alignment with project conventions, and approved publication.
Codex was asked to:
Codex reviewed the build history, asm.js rules, and V8 behavior; changed
return btoreturn b | 0; and added an explicit asm.js validation test.Validation covered published versions 2.0.0–2.3.1, Node 16–25, full and minimal bundles, and behavior comparison across 20 source files. The complete
chomp testmatrix is pending CI approval.Summary
Since 2.2.0, invoking the
es-module-lexer/jsbuild under V8 emits:The bundle remains valid JavaScript, so V8 falls back to normal JavaScript compilation and parsing still succeeds. This allows the existing functional tests to pass while the asm.js module itself fails validation.
The regression was introduced by #203. Its injected allocator helper returns an integer parameter without the result coercion required by asm.js:
Returning
bis the intended behavior; only its asm.js return type annotation is missing.Changes
return b | 0The additional coercion does not change runtime behavior because
bhas already been converted withb = b | 0.Test plan
chomp testmatrix in CI with the Emscripten and Fastcomp toolchains