Make Promise::reject_error sound

This commit is contained in:
Anthony Ramine 2017-09-21 18:22:20 +02:00
parent 15acd1525e
commit af2e83f378
19 changed files with 110 additions and 94 deletions

View file

@ -173,7 +173,9 @@ impl Promise {
}
#[allow(unsafe_code)]
pub fn reject_error(&self, cx: *mut JSContext, error: Error) {
pub fn reject_error(&self, error: Error) {
let cx = self.global().get_cx();
let _ac = JSAutoCompartment::new(cx, self.reflector().get_jsobject().get());
rooted!(in(cx) let mut v = UndefinedValue());
unsafe {
error.to_jsval(cx, &self.global(), v.handle_mut());