Go to file
caitpotter88 7459d8cecb [promise] Make Promise.all match spec, and always respect [[AlreadyResolved]]
Testing the promise status is not enough to ensure that resolve functions are
called only once.

This change adds a similar version of the [[AlreadyResolved]] slot to the
Promise.all resolve element function, and also ensures that [[AlreadyResolved]]
is respected in the Promise executor, and when resolving thenables. This means
replacing PromiseReject() shortcuts with promiseCapability.reject(), which has
an [[AlreadyResolved]] record in a context slot.

Also ensures that changes to the list accumulator in Promise.all() is not observable
via accessors installed in the Array prototype chain, using the same mechanism used
in several Array methods.

Fixes the following Test262 tests:
- built-ins/Promise/all/call-resolve-element-items.js
- built-ins/Promise/all/call-resolve-element.js
- built-ins/Promise/all/call-resolve-element-after-return.js
- built-ins/Promise/all/same-reject-function.js
- built-ins/Promise/all/resolve-from-same-thenable.js
- built-ins/Promise/all/resolve-before-loop-exit.js
- built-ins/Promise/all/resolve-before-loop-exit-from-same.js
- built-ins/Promise/exception-after-resolve-in-executor.js
- built-ins/Promise/exception-after-resolve-in-thenable-job.js
- built-ins/Promise/all/does-not-invoke-array-setters.js

BUG=v8:4633
LOG=N
R=littledan@chromium.org, cbruni@chromium.org

Review URL: https://codereview.chromium.org/1534813005

Cr-Commit-Position: refs/heads/master@{#33163}
2016-01-07 20:24:26 +00:00
benchmarks Revert "Refactoring: Make gtest testsuite the default." 2014-09-02 09:17:26 +00:00
build Remove wasm compile time option and enable wasm behind a runtime flag. 2016-01-05 18:06:54 +00:00
docs [Docs] Removed unused docs because they are moved to GitHub 2015-11-19 10:23:30 +00:00
include Add UseCounters for various standards-related code paths 2016-01-07 00:13:03 +00:00
infra Revert of [CQ] Temporarily switch off pure swarming bots. (patchset #1 id:1 of https://codereview.chromium.org/1502143005/ ) 2015-12-09 07:43:41 +00:00
samples Disable soon to be deprecated APIs per default for v8 2015-12-09 10:35:04 +00:00
src [promise] Make Promise.all match spec, and always respect [[AlreadyResolved]] 2016-01-07 20:24:26 +00:00
test [promise] Make Promise.all match spec, and always respect [[AlreadyResolved]] 2016-01-07 20:24:26 +00:00
testing Converted V8 CQ config to proto-format 2015-05-28 15:02:53 +00:00
third_party/binutils Update binutils version. 2015-08-07 08:09:49 +00:00
tools Whitespace change to test swarming switch. 2016-01-07 13:56:12 +00:00
.clang-format Change clang-format config to allow for two empty lines between functions 2013-12-03 10:39:21 +00:00
.gitignore Update DEPS entry for tracing to point at correct location 2015-12-16 12:17:06 +00:00
.ycm_extra_conf.py [ycm] The YouCompleteMe configuration is not VIM specific. 2015-02-12 07:21:13 +00:00
AUTHORS Add Isolate::DiscardThreadSpecificMetadata method to embedder API. 2015-12-16 15:49:49 +00:00
BUILD.gn [Interpreter] Add support for jumps using constants with wide operands. 2016-01-05 19:09:10 +00:00
ChangeLog Update change log to match roll branch. 2015-05-18 15:03:50 +00:00
codereview.settings Use v8-reviews@ for review mail, so v8-dev@ is free for dev discussions 2015-09-09 08:14:11 +00:00
DEPS Update V8 DEPS. 2016-01-07 04:24:35 +00:00
LICENSE Updates to the license information of third party components. 2015-06-16 12:37:50 +00:00
LICENSE.strongtalk Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.v8 Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.valgrind Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
Makefile Remove wasm compile time option and enable wasm behind a runtime flag. 2016-01-05 18:06:54 +00:00
Makefile.android Reland [android] Migrate more configs to gyp. 2015-06-26 12:04:09 +00:00
Makefile.nacl Use the pnacl-clang toolchain for (P)NaCL builds 2014-10-06 08:10:50 +00:00
OWNERS Update OWNERS file. 2015-07-16 11:37:51 +00:00
PRESUBMIT.py [CQ] Add new triggered win trybots to CQ. 2015-12-03 15:01:06 +00:00
README.md [Docs] Removed unused docs because they are moved to GitHub 2015-11-19 10:23:30 +00:00
snapshot_toolchain.gni Map arm64 and mips64el -> x64 for mksnapshot 2015-12-16 15:17:37 +00:00
WATCHLISTS [Release] CC hpayer@ and ulan@ to every heap change 2015-12-02 12:49:50 +00:00

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://github.com/v8/v8/wiki

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*

Contributing

Please follow the instructions mentioned on the V8 wiki.