Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@leso-kn
Copy link

@leso-kn leso-kn commented May 28, 2025

This PR adds support for calling constructors!

It triggers when calling a javascript class from lua. Classes are distinguished from generic functions by the .constructor-field.

Syntax:

local ws = window.WebSocket("https://example.org")

-- ws is a new instance of WebSocket
ws.send 'hello example.org!'

Copy link
Contributor

@RodrigoDornelles RodrigoDornelles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leso-kn leso-kn force-pushed the constructors branch 2 times, most recently from 9a32e3e to fd97b6a Compare June 12, 2025 08:22
@leso-kn
Copy link
Author

leso-kn commented Jun 12, 2025

@ceifa @RodrigoDornelles Linter warnings should be fixed :)

(verified here: leso-kn:wasmoon run#15605367128)

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