Skip to content

Use web spec best practices #450

@zolkis

Description

@zolkis

Originally posted by @inexorabletash in #446 (comment)

Drive by comment: the first step here (If a or b is not an instance of MLOperand, then throw a "TypeError"...) is unnecessary, and I see this repeated throughout the newly introduced algorithms for methods ("operations" in Web IDL). The Web IDL bindings already take care validating input types and throwing TypeError.

Further, even in cases where an explicit error must be thrown, the intrinsic type TypeError should be thrown, not a DOMException of type "TypeError" (which is not present in https://webidl.spec.whatwg.org/#idl-DOMException-error-names)

(Issue created to document this change).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions