Skip to content

'toString' is supposed to be a valid operation argument name #785

Open
@nektro

Description

@nektro

Under https://webidl.spec.whatwg.org/#idl-names

The identifier of any of the abovementioned IDL constructs (except operation arguments) must not be "constructor", "toString", or begin with a U+005F (_). These are known as reserved identifiers.

this is to have users use Constructor and Stringifier respectively.

however, taking note of the exception, it appears the following code should pass even though today it fails the checker:

[Exposed]
interface Foo {
  undefined foo(int toString);
};
WebIDLParseError: Syntax error at line 3:
  undefined foo(int toString
                    ^ toString is a reserved identifier and must not be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions