|
|
|
A Job with no parameters that initiates an ECMAScript computation when no other ECMAScript computation is currently in progress. Jobs are scheduled for execution by ECMAScript environments. This specification describes the to schedule one kind of job; hosts may define additional jobs. Such operations accept a as the parameter and schedule it to be performed at some future time. Their implementations must conform to the following requirements: At some future point in time, when there is no is empty, the implementation must: 1. Perform any preparation steps. 2. . 3. Perform any cleanup steps, after which the may be actively undergoing evaluation at any point in time. Once evaluation of a starts, it must run to completion before evaluation of any other must return a normal completion, implementing its own handling of errors. NOTE 1 At any particular time, scriptOrModule , a null ) is the active script or module if all of the following conditions are true: () is scriptOrModule . whose ScriptOrModule component is scriptOrModule .[[Realm]]. At any particular time, an execution is prepared to evaluate ECMAScript code if all of the following conditions are true: component of the topmost . NOTE 2 Particular kinds of Jobs have additional conformance requirements. A JobCallback Record value. Function objects that environments are not required to treat Jobs uniformly with respect to scheduling. For example, web browsers and Node.js treat Promise-handling Jobs as a higher priority than other environments may prepare an execution to evaluate code by pushing execution contexts onto the . The specific steps are . is up to the and is only in use before any callback function is invoked. When a callback function related to a , like a Promise handler, is invoked, the invocation pushes its own . 9.4 Jobs and Host Operations to Enqueue Jobs 9.4.1 JobCallback Records 211 |