From 2508c60dcd81d2c2ff909f79690e499601aa4261 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 19 May 2016 15:59:48 -0400 Subject: [PATCH] Handle incumbent settings object for promise jobs --- source | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/source b/source index 957b0a191aa..2d85b693ee1 100644 --- a/source +++ b/source @@ -86682,8 +86682,8 @@ interface NavigatorOnLine { stack, initially empty. Roughly speaking, it is used to determine the incumbent settings object when no author code is on the stack, but author code is responsible for the current algorithm having been run in some way. When Web IDL is used to invoke author code, it manipulates this stack.

+ data-x="es-invoking-callback-functions">invoke author code, or when EnqueueJob + invokes a promise job, they manipulate this stack.

The incumbent settings object is determined as follows:

@@ -86912,19 +86912,24 @@ interface NavigatorOnLine {
  1. Assert: queueName is "PromiseJobs". ("ScriptJobs" must not be used by user agents.)

  2. -
  3. Let settings be the settings +

  4. Let job settings be the settings object of job.[[Realm]].

  5. +
  6. Let incumbent settings be the incumbent settings object.

  7. -

    Queue a microtask, on settings's responsible event +

    Queue a microtask, on job settings's responsible event loop, to perform the following steps:

      -
    1. Check if we can run script with settings. If this returns "do - not run" then abort these steps.

    2. -
    3. Prepare to run script with settings.

    4. +
    5. Check if we can run script with job settings. If this returns + "do not run" then abort these steps.

    6. +
    7. Push incumbent settings onto the backup incumbent settings object + stack.

    8. +
    9. Prepare to run script with job settings.

    10. Let result be the result of performing the abstract operation specified by job, using the elements of arguments as its arguments.

    11. -
    12. Clean up after running script with settings.

    13. +
    14. Clean up after running script with job settings.

    15. +
    16. Pop incumbent settings off of the backup incumbent settings object + stack.

    17. If result is an abrupt completion, report the exception given by result.[[Value]].