diff --git a/dom/webidl/BluetoothAdapter2.webidl b/dom/webidl/BluetoothAdapter2.webidl index 45d9d73b1967..829b64911dce 100644 --- a/dom/webidl/BluetoothAdapter2.webidl +++ b/dom/webidl/BluetoothAdapter2.webidl @@ -72,24 +72,24 @@ interface BluetoothAdapter : EventTarget { * Several onattributechanged events would be triggered during processing the * request, and the last one indicates adapter.state becomes enabled/disabled. */ - [NewObject, Throws] + [NewObject] Promise enable(); - [NewObject, Throws] + [NewObject] Promise disable(); - [NewObject, Throws] + [NewObject] Promise setName(DOMString aName); - [NewObject, Throws] + [NewObject] Promise setDiscoverable(boolean aDiscoverable); - [NewObject, Throws] + [NewObject] Promise startDiscovery(); - [NewObject, Throws] + [NewObject] Promise stopDiscovery(); - [NewObject, Throws] + [NewObject] Promise pair(DOMString deviceAddress); - [NewObject, Throws] + [NewObject] Promise unpair(DOMString deviceAddress); sequence getPairedDevices(); diff --git a/dom/webidl/BluetoothDevice2.webidl b/dom/webidl/BluetoothDevice2.webidl index 2eceaca9e6c3..d1963bf061c4 100644 --- a/dom/webidl/BluetoothDevice2.webidl +++ b/dom/webidl/BluetoothDevice2.webidl @@ -26,7 +26,7 @@ interface BluetoothDevice : EventTarget * If the operation succeeds, the promise will be resolved with up-to-date * UUID list which is identical to attribute uuids. */ - [NewObject, Throws] + [NewObject] Promise> fetchUuids(); }; diff --git a/dom/webidl/BluetoothPairingHandle.webidl b/dom/webidl/BluetoothPairingHandle.webidl index 8a850b911b16..ad75fdcddc93 100644 --- a/dom/webidl/BluetoothPairingHandle.webidl +++ b/dom/webidl/BluetoothPairingHandle.webidl @@ -13,8 +13,8 @@ interface BluetoothPairingHandle */ readonly attribute DOMString passkey; - [NewObject, Throws] + [NewObject] Promise setPinCode(DOMString aPinCode); - [NewObject, Throws] + [NewObject] Promise setPairingConfirmation(boolean aConfirm); }; diff --git a/dom/webidl/DOMRequest.webidl b/dom/webidl/DOMRequest.webidl index 039446904563..53686ab11304 100644 --- a/dom/webidl/DOMRequest.webidl +++ b/dom/webidl/DOMRequest.webidl @@ -19,7 +19,7 @@ interface DOMRequestShared { interface DOMRequest : EventTarget { // The [TreatNonCallableAsNull] annotation is required since then() should do // nothing instead of throwing errors when non-callable arguments are passed. - [NewObject, Throws] + [NewObject] Promise then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null, [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null); }; diff --git a/dom/webidl/DeviceStorage.webidl b/dom/webidl/DeviceStorage.webidl index ba2d6a4a1b2a..2b31fcc3fcf1 100644 --- a/dom/webidl/DeviceStorage.webidl +++ b/dom/webidl/DeviceStorage.webidl @@ -86,7 +86,7 @@ interface DeviceStorage : EventTarget { // Indicates if the storage area denoted by storageName is removable readonly attribute boolean isRemovable; - [NewObject, Throws] + [NewObject] // XXXbz what type does this really return? Promise getRoot(); }; diff --git a/dom/webidl/Directory.webidl b/dom/webidl/Directory.webidl index cab6b4210edd..f60b2ad6bb9d 100644 --- a/dom/webidl/Directory.webidl +++ b/dom/webidl/Directory.webidl @@ -35,7 +35,7 @@ interface Directory { * @return If succeeds, the promise is resolved with the new created * File object. Otherwise, rejected with a DOM error. */ - [NewObject, Throws] + [NewObject] Promise createFile(DOMString path, optional CreateFileOptions options); /* @@ -47,7 +47,7 @@ interface Directory { * @return If succeeds, the promise is resolved with the new created * Directory object. Otherwise, rejected with a DOM error. */ - [NewObject, Throws] + [NewObject] Promise createDirectory(DOMString path); /* @@ -58,7 +58,7 @@ interface Directory { * with a File or Directory object, depending on the entry's type. Otherwise, * rejected with a DOM error. */ - [NewObject, Throws] + [NewObject] Promise<(File or Directory)> get(DOMString path); /* @@ -72,7 +72,7 @@ interface Directory { * exist, the promise is resolved with boolean false. If the target did exist * and was successfully deleted, the promise is resolved with boolean true. */ - [NewObject, Throws] + [NewObject] Promise remove((DOMString or File or Directory) path); /* @@ -86,7 +86,7 @@ interface Directory { * resolved with boolean false. If the target did exist and was successfully * deleted, the promise is resolved with boolean true. */ - [NewObject, Throws] + [NewObject] Promise removeDeep((DOMString or File or Directory) path); }; diff --git a/dom/webidl/HTMLMediaElement.webidl b/dom/webidl/HTMLMediaElement.webidl index 48426bdd8873..8522738c487d 100644 --- a/dom/webidl/HTMLMediaElement.webidl +++ b/dom/webidl/HTMLMediaElement.webidl @@ -151,7 +151,7 @@ partial interface HTMLMediaElement { readonly attribute MediaKeys? mediaKeys; // void, not any: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26457 - [Pref="media.eme.enabled", Throws, NewObject] + [Pref="media.eme.enabled", NewObject] Promise setMediaKeys(MediaKeys? mediaKeys); [Pref="media.eme.enabled"] diff --git a/dom/webidl/MediaKeySession.webidl b/dom/webidl/MediaKeySession.webidl index 4a1274ad50d7..dade9b02b795 100644 --- a/dom/webidl/MediaKeySession.webidl +++ b/dom/webidl/MediaKeySession.webidl @@ -23,22 +23,22 @@ interface MediaKeySession : EventTarget { readonly attribute Promise closed; - [NewObject, Throws] + [NewObject] Promise generateRequest(DOMString initDataType, (ArrayBufferView or ArrayBuffer) initData); - [NewObject, Throws] + [NewObject] Promise load(DOMString sessionId); // session operations - [NewObject, Throws] + [NewObject] Promise update((ArrayBufferView or ArrayBuffer) response); - [NewObject, Throws] + [NewObject] Promise close(); - [NewObject, Throws] + [NewObject] Promise remove(); - [NewObject, Throws] + [NewObject] Promise> getUsableKeyIds(); }; diff --git a/dom/webidl/MediaKeySystemAccess.webidl b/dom/webidl/MediaKeySystemAccess.webidl index 9c62a8443c1e..817b29c694e6 100644 --- a/dom/webidl/MediaKeySystemAccess.webidl +++ b/dom/webidl/MediaKeySystemAccess.webidl @@ -29,6 +29,6 @@ dictionary MediaKeySystemOptions { [Pref="media.eme.enabled"] interface MediaKeySystemAccess { readonly attribute DOMString keySystem; - [NewObject, Throws] + [NewObject] Promise createMediaKeys(); }; diff --git a/dom/webidl/MediaKeys.webidl b/dom/webidl/MediaKeys.webidl index c0bf381c5ccd..3a8dd6192562 100644 --- a/dom/webidl/MediaKeys.webidl +++ b/dom/webidl/MediaKeys.webidl @@ -20,6 +20,6 @@ interface MediaKeys { [NewObject, Throws] MediaKeySession createSession(optional SessionType sessionType = "temporary"); - [NewObject, Throws] + [NewObject] Promise setServerCertificate((ArrayBufferView or ArrayBuffer) serverCertificate); }; diff --git a/dom/webidl/MozIcc.webidl b/dom/webidl/MozIcc.webidl index 09c71b84c897..693872c43fb7 100644 --- a/dom/webidl/MozIcc.webidl +++ b/dom/webidl/MozIcc.webidl @@ -351,6 +351,6 @@ interface MozIcc : EventTarget * If succeeds, the promise is resolved with boolean indicating the * availability of the service. Otherwise, rejected with a DOMError. */ - [NewObject, Throws] + [NewObject] Promise getServiceState(IccService service); }; diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl index 720b082e14d0..78ac2197d003 100644 --- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -132,7 +132,7 @@ Navigator implements NavigatorBattery; [NoInterfaceObject, Exposed=(Window,Worker)] interface NavigatorDataStore { - [Throws, NewObject, Func="Navigator::HasDataStoreSupport"] + [NewObject, Func="Navigator::HasDataStoreSupport"] Promise> getDataStores(DOMString name, optional DOMString? owner = null); }; @@ -173,7 +173,7 @@ interface NavigatorMobileId { // permission is set to PROMPT_ACTION and [CheckPermissions] only checks // for ALLOW_ACTION. // XXXbz what is this promise resolved with? - [Throws, NewObject, Func="Navigator::HasMobileIdSupport"] + [NewObject, Func="Navigator::HasMobileIdSupport"] Promise getMobileIdAssertion(optional MobileIdOptions options); }; Navigator implements NavigatorMobileId; @@ -405,7 +405,7 @@ partial interface Navigator { #ifdef MOZ_EME partial interface Navigator { - [Pref="media.eme.enabled", Throws, NewObject] + [Pref="media.eme.enabled", NewObject] Promise requestMediaKeySystemAccess(DOMString keySystem, optional sequence supportedConfigurations); diff --git a/dom/webidl/Promise.webidl b/dom/webidl/Promise.webidl index 1c19433b7bca..1f22f58e2084 100644 --- a/dom/webidl/Promise.webidl +++ b/dom/webidl/Promise.webidl @@ -27,23 +27,23 @@ interface _Promise { // the proto of a promise object or someone screws up and manages to create a // Promise object in this scope without having resolved the interface object // first. - [NewObject, Throws] + [NewObject] static Promise resolve(optional any value); - [NewObject, Throws] + [NewObject] static Promise reject(optional any value); // The [TreatNonCallableAsNull] annotation is required since then() should do // nothing instead of throwing errors when non-callable arguments are passed. - [NewObject, Throws] + [NewObject] Promise then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null, [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null); - [NewObject, Throws] + [NewObject] Promise catch([TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null); - [NewObject, Throws] + [NewObject] static Promise all(sequence iterable); - [NewObject, Throws] + [NewObject] static Promise race(sequence iterable); }; diff --git a/dom/webidl/TelephonyCall.webidl b/dom/webidl/TelephonyCall.webidl index 1bfc2c2b901f..022e4a6bb418 100644 --- a/dom/webidl/TelephonyCall.webidl +++ b/dom/webidl/TelephonyCall.webidl @@ -33,13 +33,13 @@ interface TelephonyCall : EventTarget { readonly attribute TelephonyCallGroup? group; - [NewObject, Throws] + [NewObject] Promise answer(); - [NewObject, Throws] + [NewObject] Promise hangUp(); - [NewObject, Throws] + [NewObject] Promise hold(); - [NewObject, Throws] + [NewObject] Promise resume(); attribute EventHandler onstatechange; diff --git a/dom/webidl/TelephonyCallGroup.webidl b/dom/webidl/TelephonyCallGroup.webidl index f3539b5b2d81..a51ccd485223 100644 --- a/dom/webidl/TelephonyCallGroup.webidl +++ b/dom/webidl/TelephonyCallGroup.webidl @@ -17,7 +17,7 @@ interface TelephonyCallGroup : EventTarget { [Throws] void remove(TelephonyCall call); - [NewObject, Throws] + [NewObject] Promise hangUp(); [Throws] diff --git a/dom/webidl/TextEncoder.webidl b/dom/webidl/TextEncoder.webidl index 3b6973b86870..a031e6d26207 100644 --- a/dom/webidl/TextEncoder.webidl +++ b/dom/webidl/TextEncoder.webidl @@ -15,6 +15,6 @@ interface TextEncoder { [Constant] readonly attribute DOMString encoding; - [Throws, NewObject] + [NewObject] Uint8Array encode(optional USVString input = ""); }; diff --git a/dom/webidl/USSDSession.webidl b/dom/webidl/USSDSession.webidl index 4a843de236f2..5909bb7112e7 100644 --- a/dom/webidl/USSDSession.webidl +++ b/dom/webidl/USSDSession.webidl @@ -9,9 +9,9 @@ AvailableIn="CertifiedApps", Constructor(unsigned long serviceId)] interface USSDSession { - [NewObject, Throws] + [NewObject] Promise send(DOMString ussd); - [NewObject, Throws] + [NewObject] Promise cancel(); };