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

@ -554,9 +554,9 @@ impl TaskOnce for MessageReceivedTask {
// Step 2-5.
let global = ws.global();
// global.get_cx() returns a valid `JSContext` pointer, so this is safe.
// GlobalScope::get_cx() returns a valid `JSContext` pointer, so this is safe.
unsafe {
let cx = global.get_cx();
let cx = GlobalScope::get_cx();
let _ac = JSAutoRealm::new(*cx, ws.reflector().get_jsobject().get());
rooted!(in(*cx) let mut message = UndefinedValue());
match self.message {