Make Promise::reject_native sound

This commit is contained in:
Anthony Ramine 2017-09-21 16:19:29 +02:00
parent 5addc2dfa3
commit 15acd1525e
4 changed files with 11 additions and 9 deletions

View file

@ -284,7 +284,7 @@ impl VRDisplayMethods for VRDisplay {
// WebVR spec: If canPresent is false the promise MUST be rejected
if !self.display.borrow().capabilities.can_present {
let msg = "VRDisplay canPresent is false".to_string();
promise.reject_native(promise.global().get_cx(), &msg);
promise.reject_native(&msg);
return promise;
}
@ -294,7 +294,7 @@ impl VRDisplayMethods for VRDisplay {
// That functionality is not allowed by this revision of the spec.
if layers.len() != 1 {
let msg = "The number of layers must be 1".to_string();
promise.reject_native(promise.global().get_cx(), &msg);
promise.reject_native(&msg);
return promise;
}
@ -311,7 +311,7 @@ impl VRDisplayMethods for VRDisplay {
},
Err(msg) => {
let msg = msg.to_string();
promise.reject_native(promise.global().get_cx(), &msg);
promise.reject_native(&msg);
return promise;
}
};
@ -338,7 +338,7 @@ impl VRDisplayMethods for VRDisplay {
promise.resolve_native(&());
},
Err(e) => {
promise.reject_native(promise.global().get_cx(), &e);
promise.reject_native(&e);
}
}
@ -353,7 +353,7 @@ impl VRDisplayMethods for VRDisplay {
// WebVR spec: If the VRDisplay is not presenting the promise MUST be rejected.
if !self.presenting.get() {
let msg = "VRDisplay is not presenting".to_string();
promise.reject_native(promise.global().get_cx(), &msg);
promise.reject_native(&msg);
return promise;
}
@ -369,7 +369,7 @@ impl VRDisplayMethods for VRDisplay {
promise.resolve_native(&());
},
Err(e) => {
promise.reject_native(promise.global().get_cx(), &e);
promise.reject_native(&e);
}
}