Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class.new(...args) vs Class.create(...args) #86

Open
WebReflection opened this issue Aug 8, 2023 · 5 comments
Open

Class.new(...args) vs Class.create(...args) #86

WebReflection opened this issue Aug 8, 2023 · 5 comments

Comments

@WebReflection
Copy link

There's a lengthy discussion in TC39 around classes instantiations and I've realized wasmoon wraps these as arrow function which can't ever be used with new in general, but it also uses Class.create() instead of the more acknowledged and developer friendly (because it's backed by JS new syntax) Class.new(...args) pattern.

Beside the TC39 discussion though, it would be very community friendly if all interpreters with instantiation ability would follow a common pattern such as Class.new(...args) is, compared with .create(...) in wasmoon or pm.new(pm.Thing)(...args) in PythonMonkey.

As summary: please consider offering .new(...args) convention to instantiate JS objects within the wasmoon runtime, thank you!

@ParadiseFallen
Copy link

@WebReflection you can just fork it and provide samplels and actuall impl of it

@WebReflection
Copy link
Author

WebReflection commented Aug 8, 2023

I'm afraid I am going on vacation next couple of weeks and I have other issues to tackle internally (before that) ... but if this is the answer, I will eventually try to do what you suggested, although it will surely take a long while.

@ParadiseFallen
Copy link

@WebReflection im not a contributor and not an author.
It seems that original wasmoon creator not contributing too much now. So if you want changes it seems much easier to just bringh it on your own (as i do).

@WebReflection
Copy link
Author

@ParadiseFallen oh no, we clarified that aspect already #85 (comment)

@ParadiseFallen
Copy link

@WebReflection fine

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

No branches or pull requests

2 participants