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.
This commit is contained in:
Anthony Ramine 2017-09-21 16:00:48 +02:00
parent 658dc8a501
commit 5addc2dfa3
17 changed files with 42 additions and 53 deletions

View file

@ -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())),
}