Skip to content

Conversation

@kateinoigakukun
Copy link
Member

Motivation:

  • Import-side arrays lacked ordering guarantees when multiple stack-based parameters were present and we were missing coverage for arrays in imported JS class members.

Overview:

  • Reverse stack-based parameter lowering in ImportTS, deduplicate raw-value enum handling, and ensure lift fragments without parameters run so array returns are emitted.
  • Add ArrayHost fixtures and runtime checks for JSClass array properties/methods, wire them into the JS prelude, and regenerate BridgeJS outputs.

@kateinoigakukun kateinoigakukun force-pushed the katei/18e3-bridgejs-import branch 3 times, most recently from 731032d to c1b87ad Compare February 4, 2026 07:53
…SCore/ImportTS.swift` to allow array lowering/lifting (stack-based, no ABI params) and to handle stack-only parameters in `CallJSEmission`. `Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift` now lifts array parameters and lowers array returns for imported JS functions using existing array fragments. `Sources/JavaScriptKit/BridgeJSIntrinsics.swift` gives `Array` stack bridging conformance plus import helpers (`bridgeJSLowerParameter`, `bridgeJSLiftReturn`, `bridgeJSLowerStackReturn`), covering nested arrays. Added `Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/ImportArray.swift` with corresponding snapshots for JSFunction array imports.

Tests: `UPDATE_SNAPSHOTS=1 swift test --package-path ./Plugins/BridgeJS --filter BridgeJSCodegenTests` followed by `swift test --package-path ./Plugins/BridgeJS --filter BridgeJSCodegenTests` (pass).

Next steps: 1) Run the full BridgeJS test suite (`swift test --package-path ./Plugins/BridgeJS`) to ensure wider coverage. 2) Consider runtime-side coverage (e.g., `make unittest` with `JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS=1`) if you want to exercise the new import path end-to-end.
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