• caitpotter88's avatar
    [es6] refactor Promise resolution · 24ff30b7
    caitpotter88 authored
    Several changes are included here:
    
    1. Each resolution callback references shared data indicating whether
    it has already been resolved or not, as described in 25.4.1.3
    http://tc39.github.io/ecma262/#sec-createresolvingfunctions.
    Previously this was handled exclusively by the Promise's status,
    which does not work correctly with the current chaining behaviour.
    
    2. During fulfillment, When a Promise is resolved with a thenable, the
    spec chains the promises together by invoking the thenable's `then`
    function with the original Promise's resolve and reject methods (per
    section 25.4.2.2, or
    http://tc39.github.io/ecma262/#sec-promiseresolvethenablejob, on the
    next tick, regardless of whether or not there are pending tasks.
    
    3. Adds a spec compliance fix to ensure that the Promise constructor
    is only loaded once when `then()` is called, solving v8:4539 as well.
    This involves refactoring PromiseChain to accept a constructor
    argument. PromiseChain/PromiseDeferred will hopefully be removed soon,
    simplifying the process.
    
    BUG=v8:4162, v8:4539, v8:3237
    LOG=N
    R=rossberg@chromium.org, littledan@chromium.org, adamk@chromium.org
    
    Review URL: https://codereview.chromium.org/1394463003
    
    Cr-Commit-Position: refs/heads/master@{#32046}
    24ff30b7
Name
Last commit
Last update
..
array-iterator.js Loading commit data...
array.js Loading commit data...
arraybuffer.js Loading commit data...
code-stubs.js Loading commit data...
collection-iterator.js Loading commit data...
collection.js Loading commit data...
date.js Loading commit data...
generator.js Loading commit data...
harmony-array-includes.js Loading commit data...
harmony-atomics.js Loading commit data...
harmony-object-observe.js Loading commit data...
harmony-reflect.js Loading commit data...
harmony-regexp.js Loading commit data...
harmony-sharedarraybuffer.js Loading commit data...
harmony-simd.js Loading commit data...
i18n.js Loading commit data...
iterator-prototype.js Loading commit data...
json.js Loading commit data...
macros.py Loading commit data...
math.js Loading commit data...
messages.js Loading commit data...
object-observe.js Loading commit data...
prologue.js Loading commit data...
promise.js Loading commit data...
proxy.js Loading commit data...
regexp.js Loading commit data...
runtime.js Loading commit data...
spread.js Loading commit data...
string-iterator.js Loading commit data...
string.js Loading commit data...
symbol.js Loading commit data...
templates.js Loading commit data...
typedarray.js Loading commit data...
uri.js Loading commit data...
v8natives.js Loading commit data...
weak-collection.js Loading commit data...