From cb4390c05201cf7f2f992edf835574ce1369bc61 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sun, 30 Apr 2017 10:17:12 +0200 Subject: [PATCH] Editorial: modernize perform a microtask checkpoint --- source | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/source b/source index 98217028f8c..018e1770502 100644 --- a/source +++ b/source @@ -89228,43 +89228,41 @@ dictionary PromiseRejectionEventInit : EventInit { following steps:

    +
  1. Set the performing a microtask checkpoint flag to true.

  2. -
  3. Let the performing a microtask checkpoint flag be true.

  4. - -
  5. Microtask queue handling: If the event loop's microtask - queue is empty, jump to the done step below.

  6. +
  7. +

    While the event loop's microtask queue is not empty:

    -
  8. Select the oldest microtask on the event loop's microtask - queue.

  9. +
      +
    1. Let oldestMicrotask be the oldest microtask on the event + loop's microtask queue.

    2. -
    3. Set the event loop's currently running task to the task selected in the previous step.

    4. +
    5. Set the event loop's currently running task to + oldestMicrotask.

    6. -
    7. +
    8. +

      Run: Run oldestMicrotask.

      -

      Run: Run the selected task.

      +

      This might involve invoking scripted callbacks, which eventually calls the + clean up after running script steps, which call this perform a microtask + checkpoint algorithm again, which is why we use the performing a microtask + checkpoint flag to avoid reentrancy.

      +
    9. -

      This might involve invoking scripted callbacks, which eventually calls the - clean up after running script steps, which call this perform a microtask - checkpoint algorithm again, which is why we use the performing a microtask - checkpoint flag to avoid reentrancy.

      +
    10. Set the event loop's currently running task back to + null.

    11. +
    12. Remove oldestMicrotask from the microtask queue.

    13. +
    -
  10. Set the event loop's currently running task back to - null.

  11. - -
  12. Remove the microtask run in the step above from the microtask - queue, and return to the microtask queue handling step.

  13. - -
  14. Done: For each environment settings object whose responsible - event loop is this event loop, notify about rejected promises - on that environment settings object.

  15. +
  16. For each environment settings object whose responsible event + loop is this event loop, notify about rejected promises on that + environment settings object.

  17. Cleanup Indexed Database transactions.

  18. -
  19. Let the performing a microtask checkpoint flag be false.

  20. - +
  21. Set the performing a microtask checkpoint flag to false.

If, while a compound microtask is running, the user agent is required to