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:
@@ -2009,7 +2009,7 @@ impl ScriptThread {
|
||||
let global = self.documents.borrow().find_global(id);
|
||||
global.map(|global| enter_realm(&*global))
|
||||
});
|
||||
task.run_box()
|
||||
task.run_box(cx)
|
||||
},
|
||||
MainThreadScriptMsg::Common(CommonScriptMsg::CollectReports(chan)) => {
|
||||
self.collect_reports(chan)
|
||||
|
||||
Reference in New Issue
Block a user