Function mozjs::jsapi::JobQueueIsEmpty

source ยท
pub unsafe extern "C" fn JobQueueIsEmpty(cx: *mut JSContext)
Expand description

Inform the runtime that the job queue is empty and the embedding is going to execute its last promise job. The runtime may now choose to skip creating promise jobs for asynchronous execution and instead continue execution synchronously. More specifically, this optimization is used to skip the standard job queuing behavior for await operations in async functions.

This function may be called before executing the last job in the job queue. When it was called, JobQueueMayNotBeEmpty must be called in order to restore the default job queuing behavior before the embedding enqueues its next job into the job queue.