mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
658dc8a501
commit
5addc2dfa3
17 changed files with 42 additions and 53 deletions
|
@ -320,7 +320,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
if self.presenting.get() {
|
||||
*self.layer.borrow_mut() = layer_bounds;
|
||||
self.layer_ctx.set(Some(&layer_ctx));
|
||||
promise.resolve_native(promise.global().get_cx(), &());
|
||||
promise.resolve_native(&());
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
*self.layer.borrow_mut() = layer_bounds;
|
||||
self.layer_ctx.set(Some(&layer_ctx));
|
||||
self.init_present();
|
||||
promise.resolve_native(promise.global().get_cx(), &());
|
||||
promise.resolve_native(&());
|
||||
},
|
||||
Err(e) => {
|
||||
promise.reject_native(promise.global().get_cx(), &e);
|
||||
|
@ -366,7 +366,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
match receiver.recv().unwrap() {
|
||||
Ok(()) => {
|
||||
self.stop_present();
|
||||
promise.resolve_native(promise.global().get_cx(), &());
|
||||
promise.resolve_native(&());
|
||||
},
|
||||
Err(e) => {
|
||||
promise.reject_native(promise.global().get_cx(), &e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue