diff --git a/source b/source index 760de2984fc..fc32f30a920 100644 --- a/source +++ b/source @@ -3080,6 +3080,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
User agents that support JavaScript must also implement the AsyncContext + proposal. The following terms are defined there, and used in this specification: + JSASYNCCONTEXT
+ +For each promise p in list:
+For each tuple element in list:
Let p be element[0]. +
If p's [[PromiseIsHandled]] internal slot is true, continue to the next iteration of the loop.
Let previousContextMapping be AsyncContextSwap(element[1]).
Let notHandled be the result of firing an
event named unhandledrejection
at
global, using PromiseRejectionEvent
, with the cancelable
attribute initialized to true, the promise
attribute initialized to
p, and the reason
attribute
- initialized to the value of p's [[PromiseResult]] internal slot.
Perform AsyncContextSwap(previousContextMapping).
If notHandled is false, then the promise rejection is handled. Otherwise, the promise rejection is
@@ -106706,8 +106725,11 @@ dictionary PromiseRejectionEventInit : EventInitIf operation is "reject
", then:
Append promise to settings - object's about-to-be-notified rejected promises list.
Let snapshot be AsyncContextSnapshot().
Append (promise, snapshot) to + settings object's about-to-be-notified rejected promises list.
If settings object's about-to-be-notified rejected promises - list contains promise, then remove promise from that list and return.
If settings object's outstanding rejected promises weak set does not contain promise, then return.
promise
attribute initialized to
promise, and the reason
- attribute initialized to promise.[[PromiseResult]].
+ attribute initialized to promise.[[PromiseResult]], and useCallerAsyncContextFlag
+ set.
Let previousContextMapping be AsyncContextSwap(callback.[[AsyncContextSnapshot]]).
Let result be Call(callback.[[Callback]], V, argumentsList).
Perform AsyncContextSwap(previousContextMapping).
If script execution context is not null, then pop script execution context from the JavaScript execution context stack.
Let snapshot be AsyncContextSnapshot().
Return the JobCallback Record { [[Callback]]: callable, + [[AsyncContextSnapshot]]: snapshot, [[HostDefined]]: { [[IncumbentSettings]]: incumbent settings, [[ActiveScriptContext]]: script execution context } }.
Set eventHandler's value to the - internal raw uncompiled handler value/location.
Activate an event handler given eventTarget and localName.
When the user agent is to get the
@@ -109241,9 +109279,11 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl
Let eventHandler be handlerMap[name]. Let value be eventHandler's
+ value. If eventHandler's value is an
- internal raw uncompiled handler, then: If value is an internal raw uncompiled handler, then: If eventTarget is an element, then let element be
@@ -109255,11 +109295,9 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl
If scripting is disabled for
document, then return null. Let body be the uncompiled script body in eventHandler's value. Let body be value[0]. Let location be the location where the script body originated, as
- given by eventHandler's value. Let location be value[1]. If element is not null and element has a
form owner, let form owner be that form owner.
@@ -109414,10 +109452,13 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl
Let context be the tuple (settings object,
+ value[2]). Set eventHandler's value to the
result of creating a Web IDL
EventHandler
callback function object whose object
- reference is function and whose callback context is settings
- object.WindowProxy
that corresponds to
global.
Let snapshot be AsyncContextSnapshot().
If previousId was given, let id be previousId; otherwise, let id be an implementation-defined integer that is greater than zero and does not already exist in global's @@ -110704,6 +110748,10 @@ partial interface ShadowRoot {
If id does not exist in global's map of active timers, then abort these steps.
Let previousContextMapping be AsyncContextSwap(callback.[[AsyncContextSnapshot]]).
If handler is a Perform HostEnsureCanCompileStrings(realm).
- If this throws an exception, catch it, report the exception, and abort these
- steps.Function
, then invoke handler given
arguments with the callback this
@@ -110718,8 +110766,8 @@ partial interface ShadowRoot {
Let settings object be global's relevant settings object.
If id does not exist in global's - map of active timers, then abort these steps.
+ map of active timers, then jump to the step labeled return.It might have been removed via the author code in handler calling
clearTimeout()
or ShadowRoot
Otherwise, remove global's map of active timers[id].
Return: Perform AsyncContextSwap(previousContextMapping).
Let snapshot be AsyncContextSnapshot().
Queue a global task on the posted message task source given targetWindow to run the following steps:
@@ -114285,6 +114339,9 @@ function receiver(e) {Document
Let previousContextMapping be AsyncContextSwap(snapshot).
Let origin be the serialization of incumbentSettings's origin.
MessageEvent
, with the origin
attribute initialized to origin and
the source
attribute initialized to
- source, and then return.
+ source, and then jump to the step below labeled return.
Let messageClone be deserializeRecord.[[Deserialized]].
source
attribute initialized to source, the
data
attribute initialized to
- messageClone, and the ports
attribute
- initialized to newPorts.
+ messageClone, the ports
attribute
+ initialized to newPorts, and useCallerAsyncContextFlag flag set.
+
+ Return: Perform AsyncContextSwap(previousContextMapping).
Let snapshot be AsyncContextSnapshot().
Add a task that runs the following steps to the port message queue of targetPort:
@@ -114791,6 +114854,9 @@ dictionary StructuredSerializeOptions {Let targetRealm be finalTargetPort's relevant realm.
Let previousContextMapping be AsyncContextSwap(snapshot).
Let deserializeRecord be StructuredDeserializeWithTransfer(serializeWithTransferResult, @@ -114798,7 +114864,8 @@ dictionary StructuredSerializeOptions {
If this throws an exception, catch it, fire an
event named messageerror
at
- finalTargetPort, using MessageEvent
, and then return.
+ finalTargetPort, using MessageEvent
, and then jump to the step below
+ labeled return.
Let messageClone be deserializeRecord.[[Deserialized]].
Fire an event named message
at finalTargetPort, using
MessageEvent
, with the data
attribute
- initialized to messageClone and the messageClone, the
ports
attribute initialized to
- newPorts.
Return: Perform AsyncContextSwap(previousContextMapping).