diff --git a/source b/source index 26a0ad0309b..0ee8b1f4183 100644 --- a/source +++ b/source @@ -2938,7 +2938,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d data-x="willful violation">despite it being an officially obsoleted type according to RFC 4329.
-The following terms are defined in the ECMAScript specification and used in this specification:
+The following terms are defined in the JavaScript specification and used in this specification:
Date
class
@@ -61668,7 +61670,7 @@ interface Path2D {
Let input be the argument to coerce.
Let jsval be the result of converting - input to an ECMAScript value. If this throws an exception, then propagate the + input to a JavaScript value. If this throws an exception, then propagate the exception and abort these steps.
Let dict be the result of converting
@@ -85954,6 +85956,65 @@ interface NavigatorOnLine {
user with a mechanism to just close the page entirely, without running any unload
event handlers.
The JavaScript specification defines the JavaScript job and job queue abstractions in order to + specify certain invariants about how promise operations execute with a clean JavaScript + execution context stack and in a certain order. However, as of the time of this writing + the definitions of EnqueueJob and NextJob in that specification are not sufficiently flexible to + integrate with HTML as a host environment.
+ +This is not strictly true. It is in fact possible, by taking liberal advantage of + the many "implementation defined" sections of those algorithms, to contort them to our purposes. + However, the end result is a mass of messy indirection and workarounds that essentially bypasses + the job queue infrastructure entirely, albeit in a way that is technically sanctioned within the + bounds of implementation-defined behavior. We do not take this path, and instead introduce the + following willful violations.
+ +As such, user agents must instead use the following definitions in place of those in the + JavaScript specification. These ensure that the promise jobs enqueued by the JavaScript + specification are properly integrated into the user agent's event + loops.
+ +When the JavaScript specification says to call the EnqueueJob abstract operation, the + following algorithm must be used in place of JavaScript's EnqueueJob:
+ +Assert: queueName is "PromiseJobs"
. ("ScriptJobs"
must not be used by user agents.)
Let settings be the settings object of the script + corresponding to the running execution context.
Queue a microtask, on settings's responsible event + loop, to perform the following steps:
+ +Prepare to run a callback with settings. If this returns "do + not run" then abort these steps.
Performing the abstract operation specified by job, using the elements of + arguments as its arguments.
Clean up after running a callback with settings.
When the JavaScript specification uses the algorithm step NextJob, the following steps must be + used in place of those specified by JavaScript's NextJob:
+ +If result is an abrupt completion, report the exception given by + result.[[value]].
A more accurate name for our overridden version of NextJob would be along the + lines of "yield to host environment" or "allow host environment to react to job results".
+ @@ -86167,7 +86228,7 @@ dictionary ErrorEventInit : EventInit {ECMAScript contains an implementation-defined JavaScript contains an implementation-defined HostPromiseRejectionTracker(promise, operation) abstract operation. User agents must use the following implementation: