-
Notifications
You must be signed in to change notification settings - Fork 95
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
Stop using function-call notation #34
Comments
@allenwb, looking at the draft, I am confused about best practice for abstract operations that are not internal methods of objects. It seems clear that for internal methods, you use the "return the result of ..." quoted above. But for general abstract operations, I see any of:
Obviously I'm a fan of the last one. Which should it be? And any thoughts on the internal methods case? |
I have settled on
This is largely done except inside operations which I still anticipate other revisions for. |
any of these are fine. Depending upon the phase of the moon I might change such things. But probably not. |
This rewrite was the result of many discussions, starting in #54, but continuing into countless IM and email conversations. There were several competing concerns that arose, and I think this satisfies them all. This rewrite is inspired largely by @rossberg-chromium's https://github.com/rossberg-chromium/js-promise/blob/master/promise.js, although there were many modifications necessary to make it work and pass all the tests. In the end, the guiding principles seem to be: - Store resolution value and rejection reason, instead of trying to extract a fulfillment value from the resolution value. - Centralize all unwrapping in `then`, both on the input side (done by Promise Resolution Handler Functions) and the output side (done by Promise Reaction Functions). - Do not differentiate between promises, promise subclasses, and thenables; use the `then` interface to send messages to all of them. - More generally, do not use abstract operations when methods will do. Abstract operations should only supply the default implementation of methods. As part of this rewrite, several other issues were addressed; #36 was started on, and most editorial and formatting issues (#34, #37, #49) were taken care of. This also closes #60 by virtue of that function no longer existing. Note that the thenable coercions weak map was temporarily removed; it will be added back later (#39 #61).
Fixed by tonight/this morning's commits. |
The ES spec, unfortunately, prefers verbose things like
Whereas I have written things as
The text was updated successfully, but these errors were encountered: