wasmoon
wasmoon copied to clipboard
call function with new keyword when calling classes
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!'
@ceifa @RodrigoDornelles Linter warnings should be fixed :)
(verified here: leso-kn:wasmoon run#15605367128)