v8/src/js
caitpotter88 24ff30b740 [es6] refactor Promise resolution
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}
2015-11-17 14:24:09 +00:00
..
array-iterator.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
array.js [runtime] Remove the very dangerous %_CallFunction intrinsic. 2015-11-05 11:48:21 +00:00
arraybuffer.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
code-stubs.js [runtime] Remove the very dangerous %_CallFunction intrinsic. 2015-11-05 11:48:21 +00:00
collection-iterator.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
collection.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
date.js [runtime] Remove the very dangerous %_CallFunction intrinsic. 2015-11-05 11:48:21 +00:00
generator.js [runtime] Remove the very dangerous %_CallFunction intrinsic. 2015-11-05 11:48:21 +00:00
harmony-array-includes.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
harmony-atomics.js [builtins] Get rid of a few %_ClassOf uses. 2015-11-12 08:34:02 +00:00
harmony-object-observe.js Native context: use import/export for Object observe related functions. 2015-10-15 08:32:47 +00:00
harmony-reflect.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
harmony-regexp.js Unify setting accessor properties in native code. 2015-11-10 06:58:41 +00:00
harmony-sharedarraybuffer.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
harmony-simd.js [builtins] Get rid of a few %_ClassOf uses. 2015-11-12 08:34:02 +00:00
i18n.js [Intl] create new instances when new.target is undefined 2015-11-12 21:46:24 +00:00
iterator-prototype.js Install iterator meta objects via utils object. 2015-10-16 11:27:33 +00:00
json.js Remove JSBuiltinsObject. 2015-11-02 13:04:34 +00:00
macros.py [builtins] Get rid of a few %_ClassOf uses. 2015-11-12 08:34:02 +00:00
math.js Store RNG state on function context. 2015-11-02 13:45:23 +00:00
messages.js [runtime] support new Proxy() instead of Proxy.create and install getPrototypeOf trap 2015-11-13 14:14:07 +00:00
object-observe.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
prologue.js Unify setting accessor properties in native code. 2015-11-10 06:58:41 +00:00
promise.js [es6] refactor Promise resolution 2015-11-17 14:24:09 +00:00
proxy.js [runtime] support new Proxy() instead of Proxy.create and install getPrototypeOf trap 2015-11-13 14:14:07 +00:00
regexp.js [es6] Implement @@split subclassing. 2015-11-10 07:00:44 +00:00
runtime.js Avoid creating indexed elements at index maxUint32 2015-11-05 00:43:46 +00:00
spread.js Remove flags for spread calls and arrays 2015-10-28 15:57:27 +00:00
string-iterator.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
string.js Revert "[es6] Optimize String{Starts, Ends}With" 2015-11-13 13:18:13 +00:00
symbol.js Implement flag and source getters on RegExp.prototype. 2015-11-05 13:08:55 +00:00
templates.js [runtime] Remove the very dangerous %_CallFunction intrinsic. 2015-11-05 11:48:21 +00:00
typedarray.js [cleanup] Merge harmony-{typed,}array.js into {typed,}array.js 2015-11-04 01:08:11 +00:00
uri.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00
v8natives.js [proxies] Wire up Object.getOwnPropertyDescriptor 2015-11-17 13:08:51 +00:00
weak-collection.js Move error message makers off js builtins object. 2015-10-22 11:30:07 +00:00