Editorial: Define length of built-in accessor functions#3770
Draft
nicolo-ribaudo wants to merge 1 commit intotc39:mainfrom
Draft
Editorial: Define length of built-in accessor functions#3770nicolo-ribaudo wants to merge 1 commit intotc39:mainfrom
nicolo-ribaudo wants to merge 1 commit intotc39:mainfrom
Conversation
|
The rendered spec for this PR is available as a single page at https://tc39.es/ecma262/pr/3770 and as multiple pages at https://tc39.es/ecma262/pr/3770/multipage . |
Member
|
I don’t agree it wasn’t already specific - it just wasn’t explicit or consistent. Getters take no arguments and setters take one, so their lengths must have always been 0 and 1 respectively. |
Closed
| <p>Built-in function objects that are not constructors do not have a *"prototype"* property unless otherwise specified in the description of a particular function.</p> | ||
| <p>Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (<emu-xref href="#sec-createbuiltinfunction"></emu-xref>). 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.</p> | ||
| <p>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.</p> | ||
| <p>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 built-in get accessor functions the value is always *+0*<sub>𝔽</sub>. For built-in set accessor functions the value is always *1*<sub>𝔽</sub>.</p> |
Member
There was a problem hiding this comment.
Suggested change
| <p>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 built-in get accessor functions the value is always *+0*<sub>𝔽</sub>. For built-in set accessor functions the value is always *1*<sub>𝔽</sub>.</p> | |
| <p>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 parameter list in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count. For built-in get accessor functions, the value is always *+0*<sub>𝔽</sub>. For built-in set accessor functions, the value is always *1*<sub>𝔽</sub>.</p> |
Member
|
If you're adding parentheses to the get/set H1s, you probably want to update tc39/ecmarkup#676 to strip out the parameter list from the generated function name for accessors (but you'll need to anyway because the linter doesn't expect names of that form). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3762. Marking as "normative" because it specifies something that was not previously specified.
Marking as draft because Ecmarkup does not recognize this syntax.
At some point we might want to
<dfn>"accessor function", since it's used in a bunch of place.