mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make Promise::reject_native sound
This commit is contained in:
parent
5addc2dfa3
commit
15acd1525e
4 changed files with 11 additions and 9 deletions
|
@ -162,7 +162,9 @@ impl Promise {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn reject_native<T>(&self, cx: *mut JSContext, val: &T) where T: ToJSValConvertible {
|
||||
pub fn reject_native<T>(&self, val: &T) where T: ToJSValConvertible {
|
||||
let cx = self.global().get_cx();
|
||||
let _ac = JSAutoCompartment::new(cx, self.reflector().get_jsobject().get());
|
||||
rooted!(in(cx) let mut v = UndefinedValue());
|
||||
unsafe {
|
||||
val.to_jsval(cx, v.handle_mut());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue