summaryrefslogtreecommitdiff
path: root/dom/webidl
diff options
context:
space:
mode:
authorPale Moon <git-repo@palemoon.org>2016-03-13 14:20:07 +0100
committerPale Moon <git-repo@palemoon.org>2016-03-13 14:20:07 +0100
commit087d48d833b49981992cf30e8cc92c04d5a3d318 (patch)
treee67f76f2de0a5421ab1b61f8db0487f03631a79e /dom/webidl
parenta8a6cb509248b897a00d7a4b439efffa05e60bcc (diff)
downloadpalemoon-gre-087d48d833b49981992cf30e8cc92c04d5a3d318.tar.gz
Revert "Merge branch 'DOM-promises-work'"
This reverts commit a8a6cb509248b897a00d7a4b439efffa05e60bcc, reversing changes made to dd06188659d73f918d3773c7a265dda308e2e71d.
Diffstat (limited to 'dom/webidl')
-rw-r--r--dom/webidl/Promise.webidl22
1 files changed, 14 insertions, 8 deletions
diff --git a/dom/webidl/Promise.webidl b/dom/webidl/Promise.webidl
index 13e13f96f..b74649aec 100644
--- a/dom/webidl/Promise.webidl
+++ b/dom/webidl/Promise.webidl
@@ -7,24 +7,30 @@
* http://dom.spec.whatwg.org/#promises
*/
-// TODO We use object instead Function. There is an open issue on WebIDL to
-// have different types for "platform-provided function" and "user-provided
-// function"; for now, we just use "object".
-callback PromiseInit = void (object resolve, object reject);
+interface PromiseResolver {
+ void resolve(optional any value);
+ void reject(optional any value);
+};
+
+callback PromiseInit = void (PromiseResolver resolver);
callback AnyCallback = any (optional any value);
[PrefControlled, Constructor(PromiseInit init)]
interface Promise {
- // TODO bug 875289 - static Promise fulfill(any value);
+ // TODO: update this interface - bug 875289
+
[Creator, Throws]
static Promise resolve(any value); // same as any(value)
[Creator, Throws]
static Promise reject(any value);
[Creator]
- Promise then([TreatUndefinedAs=Missing] optional AnyCallback fulfillCallback,
- [TreatUndefinedAs=Missing] optional AnyCallback rejectCallback);
+ Promise then(optional AnyCallback? resolveCallback = null,
+ optional AnyCallback? rejectCallback = null);
[Creator]
- Promise catch([TreatUndefinedAs=Missing] optional AnyCallback rejectCallback);
+ Promise catch(optional AnyCallback? rejectCallback = null);
+
+ void done(optional AnyCallback? resolveCallback = null,
+ optional AnyCallback? rejectCallback = null);
};