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

@ -142,10 +142,7 @@ impl TrustedPromise {
let this = self;
task!(resolve_promise: move || {
debug!("Resolving promise.");
let this = this.root();
let cx = this.global().get_cx();
let _ac = JSAutoCompartment::new(cx, this.reflector().get_jsobject().get());
this.resolve_native(cx, &value);
this.root().resolve_native(&value);
})
}
}