◐ Shell
clean mode source ↗

BridgeJS: Deduplicate closure signature collection logic by kateinoigakukun · Pull Request #605 · swiftwasm/JavaScriptKit

Pull request overview

Centralizes BridgeType traversal in BridgeJSSkeleton so closure signatures can be collected consistently by both BridgeJSCore (Swift codegen) and BridgeJSLink (JS glue generation), removing duplicated traversal code.

Changes:

  • Added a BridgeTypeVisitor + BridgeTypeWalker traversal utility and a ClosureSignatureCollectorVisitor.
  • Updated BridgeJSLink to use the new walker/visitor instead of bespoke collection helpers.
  • Updated ClosureCodegen to use the new walker/visitor instead of bespoke collection helpers.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift Introduces the visitor/walker traversal utilities and a shared closure-signature collector.
Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift Switches JS glue generation to use the shared closure-signature collection logic.
Plugins/BridgeJS/Sources/BridgeJSCore/ClosureCodegen.swift Switches Swift closure-support codegen to use the shared closure-signature collection logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.