Skip to content
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

Rework Promises implementation to be Promises/A+ compliant. #82

Closed
johnyanarella opened this issue Apr 19, 2013 · 3 comments
Closed

Rework Promises implementation to be Promises/A+ compliant. #82

johnyanarella opened this issue Apr 19, 2013 · 3 comments

Comments

@johnyanarella
Copy link
Member

This work is already underway in the promises_aplus branch.

@ghost ghost assigned johnyanarella Apr 19, 2013
@johnyanarella
Copy link
Member Author

@johnyanarella
Copy link
Member Author

Issues #41 and #74 are already resolved in this new branch, as well.

@johnyanarella
Copy link
Member Author

NOTE: This commit includes breaking API changes.

Rewrote Deft JS's Promise and Deferred implementations to be Promises/A+ compliant:

  • onFulfilled and onRejected handlers are now guaranteed to be called in a future turn of the event loop (eliminating an entire class of runtime errors in applications that did not anticipate that these handlers were sometimes called immediately).
  • Rewrote cancellation as a rejection with a CancellationError.
  • Rewrote progress handler registration and propagation logic to support progress value transformation.
  • Eliminated Deferred and Promise API redundancies
    • ex. deferred.then() is now accomplished via deferred.promise.then()
  • Deft JS's Promises now pass the Promises/A+ Test Suite v1.3.1.

The new implementation is covered by 711 unit tests and will be the API that will be maintained as we move forward to version 1.0.

See also: #83, #84, #61, #74 and #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant