mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
ac3d49a744
--HG-- rename : dom/promise/Promise.cpp => dom/future/Future.cpp rename : dom/promise/Promise.h => dom/future/Future.h rename : dom/promise/PromiseCallback.cpp => dom/future/FutureCallback.cpp rename : dom/promise/PromiseCallback.h => dom/future/FutureCallback.h rename : dom/promise/PromiseResolver.cpp => dom/future/FutureResolver.cpp rename : dom/promise/PromiseResolver.h => dom/future/FutureResolver.h rename : dom/promise/Makefile.in => dom/future/Makefile.in rename : dom/promise/moz.build => dom/future/moz.build rename : dom/promise/tests/Makefile.in => dom/future/tests/Makefile.in rename : dom/promise/tests/moz.build => dom/future/tests/moz.build rename : dom/promise/tests/test_promise.html => dom/future/tests/test_future.html rename : dom/promise/tests/test_resolve.html => dom/future/tests/test_resolve.html rename : dom/webidl/Promise.webidl => dom/webidl/Future.webidl
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* The origin of this IDL file is
|
|
* http://dom.spec.whatwg.org/#futures
|
|
*/
|
|
|
|
interface FutureResolver {
|
|
void resolve(optional any value);
|
|
void reject(optional any value);
|
|
};
|
|
|
|
callback FutureInit = void (FutureResolver resolver);
|
|
callback AnyCallback = any (optional any value);
|
|
|
|
[PrefControlled, Constructor(FutureInit init)]
|
|
interface Future {
|
|
// TODO: update this interface - bug 875289
|
|
|
|
[Creator, Throws]
|
|
static Future resolve(any value); // same as any(value)
|
|
[Creator, Throws]
|
|
static Future reject(any value);
|
|
|
|
[Creator]
|
|
Future then(optional AnyCallback? resolveCallback = null,
|
|
optional AnyCallback? rejectCallback = null);
|
|
|
|
[Creator]
|
|
Future catch(optional AnyCallback? rejectCallback = null);
|
|
|
|
void done(optional AnyCallback? resolveCallback = null,
|
|
optional AnyCallback? rejectCallback = null);
|
|
};
|