mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
script: Pass &mut JSContext to tasks (#41756)
This change is reviewable per commits: In first commit we added `&mut JSContext` to `run_box` (it is very hard to bring `&mut JSContext` to `remove_script_and_layout_blocker`). In second commit we pass `&mut JSContext` to `run_once`. In third commit we added support for accepting `&mut JSContext` in closures of `task!` macro and lastly we demo new macro invocations (to ensure they actually compile) Testing: Just refactor, but should be covered by WPT Part of #40600 --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
@@ -1028,9 +1028,9 @@ impl ModuleHandler {
|
||||
}
|
||||
|
||||
impl Callback for ModuleHandler {
|
||||
fn callback(&self, _cx: &mut CurrentRealm, _v: HandleValue) {
|
||||
fn callback(&self, cx: &mut CurrentRealm, _v: HandleValue) {
|
||||
let task = self.task.borrow_mut().take().unwrap();
|
||||
task.run_box();
|
||||
task.run_box(cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user