Skip to content

Length of built-in accessor functions is not defined #3762

@nicolo-ribaudo

Description

@nicolo-ribaudo

https://tc39.es/ecma262/#sec-ecmascript-standard-built-in-objects defines that:

Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (10.3.4). The values of the length and name parameters are the initial values of the "length" and "name" properties as discussed below. The values of the prefix parameter are similarly discussed below.

Every built-in function object, including constructors, has a "length" property whose value is a non-negative integral Number. Unless otherwise specified, this value is the number of required parameters shown in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count.

For getters and setters, the subclause heading does not show arguments:

Image

We need to expand the prose in https://tc39.es/ecma262/#sec-ecmascript-standard-built-in-objects to say that getter built-in functions have length 0 and setter built-in functions have length 1, or we need to explicitly define it for the various getters and setters.

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