-
Notifications
You must be signed in to change notification settings - Fork 165
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
Pull request created for 1.0 vs. 1.1 diffs. #85
Closed
Conversation
This file contains 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
- Separate out "promise" and "thenable" concepts. - Specify that "exception" just means "value". The first of these helps greatly with the ambiguity of defining exactly what a promise is, versus the operational definition of a "thenable" as something that a promise consumes and assimilates if returned from a handler. The second helps clarify #65.
It looked pretty out of place among the rest of the terms.
This more fully specifies the manner in which thenables must be assimilated, which is useful both for clarity and for usage in future specifications, e.g. specifying the behavior of `resolve` in a promise-creation spec. The recursive nature of the thenable assimilation is a change from the current specification; see #75 for more details.
This allows passing a third parameter, e.g. with an `onProgress` forwarder. Fixes #83.
Just discovered Promises/A+ specification, and updated node-fate to comply with test suite.
1. If `x` is not a thenable, `promise` must be fulfilled with `x`. | ||
1. If `x` is a thenable, run `Assimilate(promise, x)`. | ||
1. If/when `rejectPromise` is called with a reason `reason`, `promise` must be rejected with `reason`. | ||
1. If both `resolvePromise` and `rejectPromise` are called, or multiple calls to the same argument are made, the first call takes precendence, and any further calls are ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "precendence" -> "precedence"
Review is taking place at https://github.com/promises-aplus/promises-spec/pull/85/files. Comments incorporated: - Specify that values include thenables. - Specify that `thenable.then` is called with `thenable` as `this`. - Fix a typo.
Add when 2.0.0 to implementations
This helps specify how you should get a reference to the `then` method, test it, and then call that same reference, as discussed in #88. I think it also makes the spec rather more elegant.
Pointed out by @briancavalier at d08e9dd#commitcomment-2902051.
Alternate wording for resolution of thenables proposed in #124. |
- Move `promise1 !== promise2` non-requirement to "Omissions" from "Additions". - Add `onFulfilled` and `onRejected` called as functions requirement (new in 1.1) to "Additions". - Change "returns a promise" to "returns a thenable", and expand upon what has been added (i.e. the resolution procedure). - Use "reason" instead of "rejection reason". - Rewrite the "Clarifications" section for better structure and clarity. - Add "thenable" to the list of things we clarify.
New intro, and other textual revisions
Closes #108; see some good discussion there. They will now be treated as any other cycle.
See discussion starting approximately at #108 (comment). Thanks to @erights for making this distinction clear.
Incorporates @couchdeveloper's Objective-C implementation (closes #114).
…langs Separate out implementations in other languages
Fixes #129 by prohibiting `onFulfilled` and `onRejected` from being called before the promise is respectively fulfilled or rejected. An example of behavior the current spec allows would be for an implementation to call `onFulfilled` or `onRejected` once, even on a promise that remains pending forever.
Helps clarify that Promises/A+ is a JavaScript spec. Fixes #135.
- Add that we prevent `onFulfilled` or `onRejected` from being called too early. - Add that we improved the introductory text. - Add more explanation of the Promise Resolution Procedure. - Separative changes into informative and normative.
Add SHXPromise to implementations
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.
This was the quickest way of creating the diff requested here.
Use this pull request to make line-by-line editorial comments!