diff --git a/Cargo.lock b/Cargo.lock index ec40b8813ba..ff09d540e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5240,7 +5240,7 @@ dependencies = [ [[package]] name = "mozjs" version = "0.14.1" -source = "git+https://github.com/servo/mozjs#b23161580b082e1ccfa3273d94f43f6168aedc3d" +source = "git+https://github.com/servo/mozjs#4035b0c4e9e2df5cacc68c4b71e7375a48605902" dependencies = [ "bindgen 0.71.1", "cc", @@ -5251,8 +5251,8 @@ dependencies = [ [[package]] name = "mozjs_sys" -version = "0.128.13-2" -source = "git+https://github.com/servo/mozjs#b23161580b082e1ccfa3273d94f43f6168aedc3d" +version = "0.128.13-3" +source = "git+https://github.com/servo/mozjs#4035b0c4e9e2df5cacc68c4b71e7375a48605902" dependencies = [ "bindgen 0.71.1", "cc", diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index c054ae6afef..283aa9329f1 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -87,6 +87,7 @@ use crate::task_source::SendableTaskSource; static JOB_QUEUE_TRAPS: JobQueueTraps = JobQueueTraps { getIncumbentGlobal: Some(get_incumbent_global), enqueuePromiseJob: Some(enqueue_promise_job), + runJobs: Some(run_jobs), empty: Some(empty), pushNewInterruptQueue: Some(push_new_interrupt_queue), popInterruptQueue: Some(pop_interrupt_queue), @@ -241,6 +242,17 @@ unsafe extern "C" fn get_incumbent_global(_: *const c_void, _: *mut RawJSContext result } +#[allow(unsafe_code)] +unsafe extern "C" fn run_jobs(microtask_queue: *const c_void, cx: *mut RawJSContext) { + let cx = JSContext::from_ptr(cx); + wrap_panic(&mut || { + let microtask_queue = &*(microtask_queue as *const MicrotaskQueue); + // TODO: run Promise- and User-variant Microtasks, and do #notify-about-rejected-promises. + // Those will require real `target_provider` and `globalscopes` values. + microtask_queue.checkpoint(cx, |_| None, vec![], CanGc::note()); + }); +} + #[allow(unsafe_code)] unsafe extern "C" fn empty(extra: *const c_void) -> bool { let mut result = false;