-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing definitions for "<thing> equivalent to a function that <action>" #1077
Comments
This phrase was actually added in ES2015: http://ecma-international.org/ecma-262/6.0/#sec-promisereaction-records I copied that phrasing in the "finally" spec, but afterwards, I filed #584, which refactored the existing (definitionless) usage to be strings, instead of callbacks, stored in internal slots. I think it'd be fine to add a definition, but ES2015 didn't seem to need one - what definition would you suggest and where would it go? |
That seems like a different case, because in ES2015 it was only used in a non-normative context whereas now it used for normative text. |
Fair enough :-) What definition would you suggest and where would it go? |
The easiest fix is to create normal built-in functions à la: Add: 25.6.5.3.1.1 Return Completion Functions A Return Completion function is an anonymous built-in function that has a [[Completion]] internal slot. When a Return Completion function F is called, the following steps are taken:
The length property of a Return Completion function is 0. And then replace:
With:
And replace:
With:
And if we don't want to repeat the three steps to create this new function, it's also possible to add a helper like: 25.6.5.3.1.2 MakeReturnCompletionFunction(completionRecord) The abstract operation MakeReturnCompletionFunction with argument completionRecord performs the following steps:
And then use it like:
|
A more ambitious fix would be to tackle #933. |
Related to #2222 |
Added in #1073
The text was updated successfully, but these errors were encountered: