fix(bindgen): fix async future JS codegen producing invalid output#1367
Open
wondenge wants to merge 1 commit intobytecodealliance:mainfrom
Open
fix(bindgen): fix async future JS codegen producing invalid output#1367wondenge wants to merge 1 commit intobytecodealliance:mainfrom
wondenge wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
The async future intrinsic templates produced invalid JavaScript that failed to parse when transpiling any component with future<T> types. These bugs made P3 async futures completely unusable. - Removed a stray closing parenthesis in the elementTypeRep range check - Changed self to this in four places inside drop() - in JavaScript class methods, self refers to globalThis, not the instance - Used the current variant name instead of always emitting futureWrite, which caused a duplicate declaration when rendering futureRead - Same for futureCancelRead which was emitted for both cancel variants - Renamed the second futureIdx parameter to futureEndIdx — the duplicate left futureEndIdx undefined at runtime - Also fixed the matching duplicate in the debug log object - Added the missing throw keyword before new Error in the instanceof guard, which was constructing an error and silently discarding it - Removed a broken line that called .remaining(bufferID) without the BUFFER_MGR receiver and had no closing brace - Added componentIdx to the cancel function parameter list and debug log, since the function body referenced it but never received it - Added the missing lookup to fetch the future from the global map before comparing element type reps - Replaced streamEndIdx with futureEndIdx, a copy-paste leftover from the stream equivalent - Added the missing closing parenthesis in the instanceof check
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.
The async future intrinsic templates produced invalid JavaScript that failed to parse when transpiling any component with future types. These bugs made P3 async futures completely unusable.