Skip to content

fix(bindgen): lift imported own handles via captureTable#1515

Merged
andreiltd merged 1 commit into
bytecodealliance:mainfrom
andreiltd:fix/import-handles
May 20, 2026
Merged

fix(bindgen): lift imported own handles via captureTable#1515
andreiltd merged 1 commit into
bytecodealliance:mainfrom
andreiltd:fix/import-handles

Conversation

@andreiltd
Copy link
Copy Markdown
Member

@andreiltd andreiltd commented May 20, 2026

This fixes issue with p3 http handlers throwing:

ReferenceError: finalizationRegistry{N} is not defined

For InterfaceType::Own lift ensure_resource_table only declares finalizationRegistry{tid} for guest defined resources and imported resources are tracked by captureTable{rid} instead. The pathc just mirrors the logic for Instruction::HandleLift from function_bindgen.rs file.

@andreiltd andreiltd requested a review from vados-cosmonic as a code owner May 20, 2026 05:40
vados-cosmonic
vados-cosmonic previously approved these changes May 20, 2026
Copy link
Copy Markdown
Collaborator

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM 🚀

One readability nit but otherwise good to go!

Comment thread crates/js-component-bindgen/src/transpile_bindgen.rs Outdated
This fixes issue with p3 http handlers throwing:

ReferenceError: finalizationRegistry{N} is not defined

For `InterfaceType::Own` lift, but `ensure_resource_table` only declares
`finalizationRegistry{tid}` for guest defined resources and imported
resources are tracked by `captureTable{rid}` instead. The pathc just
mirrors the logic for `Instruction::HandleLift` from function_bindgen.rs
file.
@andreiltd andreiltd force-pushed the fix/import-handles branch from 29c5a7d to 4525ed7 Compare May 20, 2026 07:01
@andreiltd andreiltd added this pull request to the merge queue May 20, 2026
Merged via the queue into bytecodealliance:main with commit ee07620 May 20, 2026
40 checks passed
@andreiltd andreiltd deleted the fix/import-handles branch May 20, 2026 07:23
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