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

@ -98,7 +98,7 @@ impl AsyncBluetoothListener for BluetoothPermissionResult {
// https://w3c.github.io/permissions/#dom-permissions-request
// Step 8.
return promise.resolve_native(promise_cx, self);
return promise.resolve_native(self);
}
let bt_device = BluetoothDevice::new(&self.global(),
DOMString::from(device.id.clone()),
@ -117,7 +117,7 @@ impl AsyncBluetoothListener for BluetoothPermissionResult {
// https://w3c.github.io/permissions/#dom-permissions-request
// Step 8.
promise.resolve_native(promise_cx, self);
promise.resolve_native(self);
},
_ => promise.reject_error(promise_cx, Error::Type("Something went wrong...".to_owned())),
}