Implement binding support for returning and accepting Promises in WebIDL.

This commit is contained in:
Josh Matthews 2016-06-21 19:35:36 -04:00
parent 73b2963509
commit a1091772ec
12 changed files with 217 additions and 20 deletions

View file

@ -0,0 +1,11 @@
/* 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/. */
// This interface is entirely internal to Servo, and should not be accessible to
// web pages.
[NoInterfaceObject]
// Need to escape "Promise" so it's treated as an identifier.
interface _Promise {
};

View file

@ -508,6 +508,11 @@ interface TestBinding {
[Func="TestBinding::condition_satisfied"]
const unsigned short funcControlledConstEnabled = 0;
Promise<DOMString> returnPromise();
readonly attribute Promise<boolean> promiseAttribute;
void acceptPromise(Promise<DOMString> string);
void acceptNullablePromise(Promise<DOMString>? string);
void panic();
};