diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-21 16:00:48 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-21 16:00:48 +0200 |
commit | 5addc2dfa36a48a657c36ecbda0331bfaa8ebf11 (patch) | |
tree | db35ab2ddce4a406097d59f697ccc01ab0a555f7 /components/script/dom/bluetooth.rs | |
parent | 658dc8a5013973ceff3c91291d5536043b2e8e58 (diff) | |
download | servo-5addc2dfa36a48a657c36ecbda0331bfaa8ebf11.tar.gz servo-5addc2dfa36a48a657c36ecbda0331bfaa8ebf11.zip |
Make Promise::resolve_native actually sound
We shouldn't have to pass a raw JSContext pointer, and to enter the
promise's context's compartment by hand.
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 526ebe576fc..f7abfaf2c02 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -514,7 +514,7 @@ impl AsyncBluetoothListener for Bluetooth { BluetoothResponse::RequestDevice(device) => { let mut device_instance_map = self.device_instance_map.borrow_mut(); if let Some(existing_device) = device_instance_map.get(&device.id.clone()) { - return promise.resolve_native(promise_cx, &**existing_device); + return promise.resolve_native(&**existing_device); } let bt_device = BluetoothDevice::new(&self.global(), DOMString::from(device.id.clone()), @@ -530,12 +530,12 @@ impl AsyncBluetoothListener for Bluetooth { ); // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice // Step 5. - promise.resolve_native(promise_cx, &bt_device); + promise.resolve_native(&bt_device); }, // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability // Step 2 - 3. BluetoothResponse::GetAvailability(is_available) => { - promise.resolve_native(promise_cx, &is_available); + promise.resolve_native(&is_available); } _ => promise.reject_error(promise_cx, Error::Type("Something went wrong...".to_owned())), } @@ -573,7 +573,7 @@ impl PermissionAlgorithm for Bluetooth { // Step 3. if let PermissionState::Denied = status.get_state() { status.set_devices(Vec::new()); - return promise.resolve_native(cx, status); + return promise.resolve_native(status); } // Step 4. @@ -637,7 +637,7 @@ impl PermissionAlgorithm for Bluetooth { // https://w3c.github.io/permissions/#dom-permissions-query // Step 7. - promise.resolve_native(cx, status); + promise.resolve_native(status); } // https://webbluetoothcg.github.io/web-bluetooth/#request-the-bluetooth-permission |