Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update differences document for recent changes and clarity.

- 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.
commit c6786b6c93891310c99d9c6d25f8d72638e48ad7 1 parent 10d9184
@domenic domenic authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 differences-from-promises-a.md
View
17 differences-from-promises-a.md
@@ -7,18 +7,23 @@ Promises/A+ is based on the concepts and `then` API presented in the [CommonJS P
The following parts of Promises/A have been intentionally omitted:
1. Progress handling: in practice, it has proven to be underspecified and currently does not have an agreed-upon or *de facto* behavior within the promise implementor community.
-1. Interactive promise: this is deemed out of scope of the minimal API necessary for interoperable promises.
+1. Interactive promises: this is deemed out of scope of the minimal API necessary for interoperable promises.
+1. `promise1 !== promise2` is *not* a requirement for `var promise2 = promise1.then(onFulfilled, onRejected)`.
## Clarifications
-1. Promise terminology: specifically, Promises/A+ standardizes on the terms "fulfilled", "rejected", "reason", and "pending".
+Promises/A+ uses different terminology from Promises/A, reflecting what has become the *de facto* vocabulary among promise implementations. Specifically:
+
+1. The promise states are given as "pending", "fulfilled", and "rejected".
+1. When promises are fulfilled, they have a "value"; when they are rejected, they have a "reason".
+1. It introduces the term "thenable" as distinct from "promise", so as to more precisely talk about the duck-typing tests necessary for implementation interoperation.
## Additions
Promises/A+ additionally specifies:
-1. the behavior in the case where `onFulfilled` or `onRejected` returns a promise;
-1. the rejection reason passed to `onRejected` must be the thrown exception in the case where a handler throws;
+1. the behavior in the case where `onFulfilled` or `onRejected` returns a thenable, including the details of the resolution procedure;
+1. the reason passed to `onRejected` must be the thrown exception in the case where a handler throws;
1. `onFulfilled` and `onRejected` must be called asynchronously;
-1. strict ordering of calls to `onFulfilled` and `onRejected` for subsequent calls to `then` on the same promise;
-1. `promise1 !== promise2` is *not* a requirement for `var promise2 = promise1.then(onFulfilled, onRejected)`.
+1. `onFulfilled` and `onRejected` must be called as functions;
+1. strict ordering of calls to `onFulfilled` and `onRejected` for subsequent calls to `then` on the same promise.
Please sign in to comment.
Something went wrong with that request. Please try again.