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

@ -264,7 +264,7 @@ impl JobQueue {
fn settle_job_promise(global: &GlobalScope, promise: &Promise, settle: SettleType) {
let _ac = JSAutoCompartment::new(global.get_cx(), promise.reflector().get_jsobject().get());
match settle {
SettleType::Resolve(reg) => promise.resolve_native(global.get_cx(), &*reg.root()),
SettleType::Resolve(reg) => promise.resolve_native(&*reg.root()),
SettleType::Reject(err) => promise.reject_error(global.get_cx(), err),
};
}