Make GlobalScope.get_cx a static method.

This commit is contained in:
Josh Matthews 2023-02-16 23:09:50 -05:00
parent 4998c65c42
commit f79e1e327d
39 changed files with 132 additions and 127 deletions

View file

@ -169,7 +169,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(*GlobalScope::get_cx()) let mut message = UndefinedValue());
if let Ok(ports) = structuredclone::read(&global, data, message.handle_mut()) {
MessageEvent::dispatch_jsval(target, &global, message.handle(), None, None, ports);
} else {
@ -247,7 +247,7 @@ impl WorkerMethods for Worker {
self.terminated.set(true);
// Step 3
let cx = self.global().get_cx();
let cx = GlobalScope::get_cx();
unsafe { JS_RequestInterruptCallback(*cx) };
}