aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bluetoothremotegattdescriptor.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-21 16:00:48 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-21 16:00:48 +0200
commit5addc2dfa36a48a657c36ecbda0331bfaa8ebf11 (patch)
treedb35ab2ddce4a406097d59f697ccc01ab0a555f7 /components/script/dom/bluetoothremotegattdescriptor.rs
parent658dc8a5013973ceff3c91291d5536043b2e8e58 (diff)
downloadservo-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/bluetoothremotegattdescriptor.rs')
-rw-r--r--components/script/dom/bluetoothremotegattdescriptor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs
index c9e24c499be..941683cbe95 100644
--- a/components/script/dom/bluetoothremotegattdescriptor.rs
+++ b/components/script/dom/bluetoothremotegattdescriptor.rs
@@ -159,7 +159,7 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTDescriptor {
*self.value.borrow_mut() = Some(value.clone());
// Step 5.4.3.
- promise.resolve_native(promise_cx, &value);
+ promise.resolve_native(&value);
},
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-writevalue
BluetoothResponse::WriteValue(result) => {
@@ -171,7 +171,7 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTDescriptor {
// Step 7.4.3.
// TODO: Resolve promise with undefined instead of a value.
- promise.resolve_native(promise_cx, &());
+ promise.resolve_native(&());
},
_ => promise.reject_error(promise_cx, Error::Type("Something went wrong...".to_owned())),
}