Skip to content

Use instance methods for type() #18

@Ms2ger

Description

@Ms2ger

Currently, the explainer has static methods, to be used like

const t = WebAssembly.Table.type(table);

rather than the rather more ergonomic

const t = table.type();

Apparently this was inspired by Object static methods such as Object.keys. However, the main reason to put new APIs on the Object constructor rather than the prototype (AFAIK) is to avoid collisions with instance properties. That doesn't apply here - we don't really expect people to put arbitrary properties on these objects. In any case, these interfaces already have all of their API on the prototype, so putting the new methods would be more consistent with that as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions