• caitpotter88's avatar
    [promise] Make Promise.reject match spec, and validate promise capabilities · e4af5cdb
    caitpotter88 authored
    Correctly validate promise capabilities in NewPromiseCapabilities() and in
    GetCapabilitiesExtractor(). Also explicitly follows Promise.race step 2 and
    similar cases in the spec, rather than passing tests asserting these steps
    are taken in NewPromiseCapability
    
    Also changes Promise.reject to match specification.
    
    Fixes the following test262 tests:
    
    - built-ins/Promise/all/capability-executor-called-twice.js
    - built-ins/Promise/all/capability-executor-not-callable.js
    - built-ins/Promise/prototype/then/capability-executor-called-twice.js
    - built-ins/Promise/prototype/then/capability-executor-not-callable.js
    - built-ins/Promise/reject/capability-executor-called-twice.js
    - built-ins/Promise/reject/capability-executor-not-callable.js
    - built-ins/Promise/resolve/capability-executor-called-twice.js
    - built-ins/Promise/resolve/capability-executor-not-callable.js
    - built-ins/Promise/race/capability-executor-called-twice.js
    - built-ins/Promise/race/capability-executor-not-callable.js
    - built-ins/Promise/reject/S25.4.4.4_A3.1_T1.js
    - built-ins/Promise/race/S25.4.4.3_A3.1_T2.js
    
    Per v8:3641, mjsunit/es6/debug-promises/throw-with-undefined-reject.js becomes invalid. The exception is thrown before the chain handler is ever invoked, and is caught externally by d8's own handler --- thus evading the uncaught exception event.
    
    BUG=v8:4633, v8:4631, v8:4243, v8:3641
    LOG=N
    R=littledan@chromium.org, cbruni@chromium.org
    
    Review URL: https://codereview.chromium.org/1531073004
    
    Cr-Commit-Position: refs/heads/master@{#33128}
    e4af5cdb
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...