Modify *::get_cx methods to return a safe JSContext instead of a raw one

This commit is contained in:
marmeladema 2019-07-22 22:14:11 +01:00
parent 2c5d0a6ebc
commit 88cacfb009
43 changed files with 306 additions and 321 deletions

View file

@ -147,7 +147,7 @@ impl Worker {
let global = worker.global();
let target = worker.upcast();
let _ac = enter_realm(target);
rooted!(in(global.get_cx()) let mut message = UndefinedValue());
rooted!(in(*global.get_cx()) let mut message = UndefinedValue());
data.read(&global, message.handle_mut());
MessageEvent::dispatch_jsval(target, &global, message.handle(), None, None);
}
@ -186,7 +186,7 @@ impl WorkerMethods for Worker {
// Step 3
let cx = self.global().get_cx();
unsafe { JS_RequestInterruptCallback(cx) };
unsafe { JS_RequestInterruptCallback(*cx) };
}
// https://html.spec.whatwg.org/multipage/#handler-worker-onmessage