Intent to replace Promise.jsm and promise.js with DOM Promises
nsm.nikhil at gmail.com
Tue Nov 19 00:38:25 UTC 2013
(Cross posted to firefox-dev, please reply on dev.platform)
DOM Promise has been in the tree for a while, and is enabled for
ChromeWorkers and certified apps. With a couple of patches, it will achieve
conformance with the AP2 spec , which is what TC39 has accepted as the
bare minimum for Promises in ECMA6. It will also be available on Workers as
long as the pref is enabled. We currently have two JS promise
implementations in our codebase:
which offer a different API and reimplement some code, one for chrome, one
My intention is:
1) Enable Promises for all chrome code.
2) Set dom.promise.enabled to true for tests
3) Migrate all users of the two promise implementations to the new style
4) Get rid of these two JS implementations.
The work is being tracked in Bug 939636 .
It would be a great help if developers who work on code using Promises
could download the patch that enables Promises in chrome and submit patches
to that bug updating code/tests.
The new spec has a different style of creating promises, which may not
interface well with callback oriented code. Feel free to ping me (nsm on
IRC) if you need help.
If there is a reason this shouldn't be done, please let me know.
At some point in the future Spidermonkey will implement Promises natively,
at which point (theoretically) all the code can simply transition to that
with no changes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the firefox-dev