Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BridgeJS: Add support for exporting structs using a box#740

Open
wfltaylor wants to merge 1 commit into
swiftwasm:mainswiftwasm/JavaScriptKit:mainfrom
wfltaylor:boxed-structwfltaylor/JavaScriptKit:boxed-structCopy head branch name to clipboard
Open

BridgeJS: Add support for exporting structs using a box#740
wfltaylor wants to merge 1 commit into
swiftwasm:mainswiftwasm/JavaScriptKit:mainfrom
wfltaylor:boxed-structwfltaylor/JavaScriptKit:boxed-structCopy head branch name to clipboard

Conversation

@wfltaylor

Copy link
Copy Markdown
Contributor

Addresses #737

Add an optional structStyle parameter, where using .reference will export the struct as a heap-allocated box. This makes the struct act like a class: @JS must be added to any property which should be exported. Much like a @JS class, JavaScript consumers can call release() to release memory without relying on FinalizationRegistry.

A copy() method is synthesised, so JS consumers can duplicate the struct.

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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.