Skip to content

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

Description

@WebReflection

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions