Skip to content

BridgeJS: Escape reserved words in exported function parameters - #822

Open
wfltaylor wants to merge 2 commits into
swiftwasm:mainfrom
wfltaylor:escape-reserved-parameter-names
Open

wfltaylor wants to merge 2 commits into
swiftwasm:mainfrom
wfltaylor:escape-reserved-parameter-names

Conversation

@wfltaylor

Copy link
Copy Markdown
Contributor

Currently parameter names using reserved words, such as extension or break, generate invalid Swift and/or JS. Reserved words are now escaped with backticks in Swift and with a leading underscore in JS. Originally I removed the parameter names from the generated thunks entirely, just using param0 param1 etc., but this made the generated code harder to read.

Comment thread Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift Outdated
Comment thread Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
@wfltaylor
wfltaylor requested a review from krodak October 28, 2026 05:13
@wfltaylor

Copy link
Copy Markdown
Contributor Author

@krodak thanks for the review, I’ve updated the PR

This branch has not been deployed

No deployments
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