BridgeJS: fix namespaced Swift class access in JS codegen#668
Merged
krodak merged 1 commit intoswiftwasm:mainfrom Feb 20, 2026
Merged
Conversation
d1fc97f to
8ebcc22
Compare
kateinoigakukun
approved these changes
Feb 20, 2026
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.
Overview
BridgeJS was generating incorrect JS class references for some
swiftHeapObjectlifting paths.This extends #642 (
BridgeJS: Use indirect _exports lookup in wrap functions) by applying the same import-side rule to all relevant class lifting paths and by adding namespace-aware_exportsresolution.For namespaced classes, generated code could try
_exports['ClassName']when the class actually lives at_exports.Namespace.Path.ClassName.In other paths, generated code could also reference class symbols directly in scopes where direct class access is not available. That caused runtime errors like
ReferenceError: <Class> is not defined.Tests
Added couple of test cases that were missing initially, confirmed that these are breaking on current main with same error I'm seeing during BridgeJS integration in other project