mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement binding support for returning and accepting Promises in WebIDL.
This commit is contained in:
parent
73b2963509
commit
a1091772ec
12 changed files with 217 additions and 20 deletions
11
components/script/dom/webidls/Promise.webidl
Normal file
11
components/script/dom/webidls/Promise.webidl
Normal 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 {
|
||||
};
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue