From a1232b916210a67f66655ddce566717d464e3602 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 2 Jun 2016 10:24:42 -0700 Subject: [PATCH] Remove upstreamed `TriggerPromiseReactions` and `[[Type]]` changes. Per https://github.com/tc39/ecma262/pull/584, update spec diff. --- index.html | 62 ++++++++++-------------------------------------------- spec.emu | 26 ++++++----------------- spec.md | 24 ++++++--------------- 3 files changed, 25 insertions(+), 87 deletions(-) diff --git a/index.html b/index.html index e62e51c..ec78fd1 100644 --- a/index.html +++ b/index.html @@ -44,19 +44,12 @@ "title": "EnqueuePromiseReactions ( _promise_, _fulfillReaction_, _rejectReaction_, _resultCapability_ )", "number": "5" }, - "sec-triggerpromisereactions": { - "location": "", - "id": "sec-triggerpromisereactions", - "aoid": "TriggerPromiseReactions", - "title": "TriggerPromiseReactions ( _reactions_, _argument_ )", - "number": "6" - }, "sec-promisereactionjob": { "location": "", "id": "sec-promisereactionjob", "aoid": "PromiseReactionJob", "title": "PromiseReactionJob ( _reaction_, _argument_ )", - "number": "7" + "number": "6" }, "sec-copyright-and-software-license": { "location": "", @@ -82,11 +75,6 @@ "id": "sec-enqueuepromisereactions", "location": "" }, - "TriggerPromiseReactions": { - "aoid": "TriggerPromiseReactions", - "id": "sec-triggerpromisereactions", - "location": "" - }, "PromiseReactionJob": { "aoid": "PromiseReactionJob", "id": "sec-promisereactionjob", @@ -122,13 +110,12 @@
  • 3 PerformPromiseFinally ( promise, onFinally, resultCapability )
  • 4 PerformPromiseThen ( promise, onFulfilled, onRejected, resultCapability )
  • 5 EnqueuePromiseReactions ( promise, fulfillReaction, rejectReaction, resultCapability )
  • -
  • 6 TriggerPromiseReactions ( reactions, argument )
  • -
  • 7 PromiseReactionJob ( reaction, argument )
  • +
  • 6 PromiseReactionJob ( reaction, argument )
  • A Copyright & Software License
  • -

    Stage 0 Draft / May 17, 2016

    +

    Stage 0 Draft / June 2, 2016

    Promise.prototype.finally

    @@ -155,11 +142,7 @@

    1Promise.prototype.finally ( onFinally

    2PromiseReaction Records#

    -

    The PromiseReaction is a Record value used to store information about how a promise should react when it becomes resolved or rejected with a given value. PromiseReaction records are created by the - PerformPromiseThen abstract operation, and are used by a - PromiseReactionJob.

    -

    PromiseReaction records have the fields listed in - Table 1.

    +

    Table 1: PromiseReaction Record Fields
    @@ -181,15 +164,15 @@

    2PromiseReaction Records - [[Capabilities]] + … - A PromiseCapability record + … - The capabilities of the promise for which this record provides a reaction handler. + … @@ -207,17 +190,15 @@

    2PromiseReaction Records - [[Handler]] + … - A function object or - undefined + … - The function that should be applied to the incoming value, and whose return value will govern what happens to the derived promise. If [[Handler]] is - undefined, a function that depends on the value of [[Type]] will be used instead. + … @@ -332,30 +313,9 @@

    5EnqueuePromiseReactions ( promise, < - - -

    6TriggerPromiseReactions ( reactions, argument )#

    -

    The abstract operation TriggerPromiseReactions takes a collection of PromiseReactionRecords and enqueues a new Job for each record. Each such Job processes the [[Type]] and [[Handler]] of the PromiseReactionRecord, and if the [[Handler]] is a function, calls it passing the given argument. If the [[Handler]] is - undefined, the behavior is determined by the [[Type]].

    - -
      -
    1. Repeat for each reaction in reactions, in original insertion order -
        -
      1. Perform - EnqueueJob("PromiseJobs", - PromiseReactionJob, « reaction, argument »).
      2. -
      -
    2. -
    3. Return - undefined. -
    4. -
    -
    -
    - -

    7PromiseReactionJob ( reaction, argument )#

    +

    6PromiseReactionJob ( reaction, argument )#

    The job PromiseReactionJob with parameters reaction and argument applies the appropriate handler to the incoming value, and uses the handler's return value to resolve or reject the derived promise associated with that handler.

      diff --git a/spec.emu b/spec.emu index fadd5cf..bcf6e42 100644 --- a/spec.emu +++ b/spec.emu @@ -23,8 +23,7 @@ contributors: Jordan Harband

      PromiseReaction Records

      -

      The PromiseReaction is a Record value used to store information about how a promise should react when it becomes resolved or rejected with a given value. PromiseReaction records are created by the PerformPromiseThen abstract operation, and are used by a PromiseReactionJob.

      -

      PromiseReaction records have the fields listed in .

      +

      @@ -41,13 +40,13 @@ contributors: Jordan Harband @@ -62,13 +61,13 @@ contributors: Jordan Harband @@ -129,17 +128,6 @@ contributors: Jordan Harband - - -

      TriggerPromiseReactions ( _reactions_, _argument_ )

      -

      The abstract operation TriggerPromiseReactions takes a collection of PromiseReactionRecords and enqueues a new Job for each record. Each such Job processes the [[Type]] and [[Handler]] of the PromiseReactionRecord, and if the [[Handler]] is a function, calls it passing the given argument. If the [[Handler]] is *undefined*, the behavior is determined by the [[Type]].

      - - 1. Repeat for each _reaction_ in _reactions_, in original insertion order - 1. Perform EnqueueJob(`"PromiseJobs"`, PromiseReactionJob, « _reaction_, _argument_ »). - 1. Return *undefined*. - -
      -

      PromiseReactionJob ( _reaction_, _argument_ )

      diff --git a/spec.md b/spec.md index 60668ff..8d8b031 100644 --- a/spec.md +++ b/spec.md @@ -9,8 +9,7 @@ When the `finally` method is called with argument _onFinally_, the following ste ## PromiseReaction Records -The PromiseReaction is a Record value used to store information about how a promise should react when it becomes resolved or rejected with a given value. PromiseReaction records are created by the PerformPromiseThen abstract operation, and are used by a PromiseReactionJob. -PromiseReaction records have the fields listed in Table 58. +…
      - [[Capabilities]] + … - A PromiseCapability record + … - The capabilities of the promise for which this record provides a reaction handler. + …
      - [[Handler]] + … - A function object or *undefined* + … - The function that should be applied to the incoming value, and whose return value will govern what happens to the derived promise. If [[Handler]] is *undefined*, a function that depends on the value of [[Type]] will be used instead. + …
      @@ -19,9 +18,9 @@ PromiseReaction records have the fields listed in Table 58. - - - + + + @@ -29,11 +28,9 @@ PromiseReaction records have the fields listed in Table 58. - - - + + +
      Meaning
      [[Capabilities]]A PromiseCapability recordThe capabilities of the promise for which this record provides a reaction handler.
      [[Type]]
      [[Handler]]A function object or undefined - The function that should be applied to the incoming value, and whose return value will govern what happens to the derived promise. If [[Handler]] is undefined, a function that depends on the value of [[Type]] will be used instead. -
      @@ -82,13 +79,6 @@ The abstract operation EnqueuePromiseReactions enqueues PromiseJobs with the pro 1. Set _promise_'s [[PromiseIsHandled]] internal slot to **true**. 1. Return _resultCapability_.[[Promise]]. -## TriggerPromiseReactions ( _reactions_, _argument_ ) - -The abstract operation TriggerPromiseReactions takes a collection of PromiseReactionRecords and enqueues a new Job for each record. Each such Job processes the [[Type]] and [[Handler]] of the PromiseReactionRecord, and if the [[Handler]] is a function, calls it passing the given argument. If the [[Handler]] is **undefined**, the behavior is determined by the [[Type]]. - 1. Repeat for each _reaction_ in _reactions_, in original insertion order - 1. Perform EnqueueJob(`"PromiseJobs"`, PromiseReactionJob, « _reaction_, _argument_ »). - 1. Return **undefined**. - ## PromiseReactionJob ( _reaction_, _argument_ ) The job PromiseReactionJob with parameters _reaction_ and _argument_ applies the appropriate handler to the incoming value, and uses the handler's return value to resolve or reject the derived promise associated with that handler.