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

@ -405,7 +405,7 @@ impl DedicatedWorkerGlobalScope {
unsafe {
// Handle interrupt requests
JS_AddInterruptCallback(scope.get_cx(), Some(interrupt_callback));
JS_AddInterruptCallback(*scope.get_cx(), Some(interrupt_callback));
}
if scope.is_closing() {
@ -466,7 +466,7 @@ impl DedicatedWorkerGlobalScope {
let scope = self.upcast::<WorkerGlobalScope>();
let target = self.upcast();
let _ac = enter_realm(self);
rooted!(in(scope.get_cx()) let mut message = UndefinedValue());
rooted!(in(*scope.get_cx()) let mut message = UndefinedValue());
data.read(scope.upcast(), message.handle_mut());
MessageEvent::dispatch_jsval(target, scope.upcast(), message.handle(), None, None);
},