script: Start using &mut JSContext in devtools and webdriver code (#42640)

This is a first step to compile scripts using `&mut JSContext`.

Testing: Refactor, covered by existing WPT tests.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24
2026-02-16 09:32:08 +01:00
committed by GitHub
parent 9ff1173166
commit c13d8a2eff
11 changed files with 118 additions and 119 deletions

View File

@@ -1791,16 +1791,10 @@ impl WindowMethods<crate::DomTypeHolder> for Window {
}
}
fn WebdriverCallback(
&self,
cx: SafeJSContext,
value: HandleValue,
realm: InRealm,
can_gc: CanGc,
) {
fn WebdriverCallback(&self, realm: &mut CurrentRealm, value: HandleValue) {
let webdriver_script_sender = self.webdriver_script_chan.borrow_mut().take();
if let Some(webdriver_script_sender) = webdriver_script_sender {
let result = jsval_to_webdriver(cx, &self.globalscope, value, realm, can_gc);
let result = jsval_to_webdriver(realm, &self.globalscope, value);
let _ = webdriver_script_sender.send(result);
}
}