Skip to content

Commit

Permalink
Unship V8 custom Promise methods
Browse files Browse the repository at this point in the history
The data from UseCounters are in--V8's custom Promise methods are not
in wide use on the web (<.002%). Therefore, this patch removes them.
That includes:
- Promise.prototype.chain
- Promise.defer -- the most widely used of the bunch
- Promise.accept

For now, those methods are still available by checking the "disable
latest stable JavaScript features" flag, or --promise-extra at the
command line, but I expect them to be fully removable.

R=adamk
CC=rossberg
BUG=v8:3238,v8:4633

Review-Url: https://codereview.chromium.org/1965183002
Cr-Commit-Position: refs/heads/master@{#36152}
  • Loading branch information
littledan authored and Commit bot committed May 11, 2016
1 parent bdf8dc4 commit fa16060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/flag-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ DEFINE_BOOL(harmony, false, "enable all completed harmony features")
DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
DEFINE_IMPLICATION(es_staging, harmony)

DEFINE_BOOL(promise_extra, true, "additional V8 Promise functions")
// Removing extra Promise functions is staged
DEFINE_NEG_IMPLICATION(harmony, promise_extra)
DEFINE_BOOL(promise_extra, false, "additional V8 Promise functions")
// Removing extra Promise functions is shipped
DEFINE_NEG_VALUE_IMPLICATION(harmony_shipping, promise_extra, true)

// Activate on ClusterFuzz.
DEFINE_IMPLICATION(es_staging, harmony_regexp_lookbehind)
Expand Down
8 changes: 4 additions & 4 deletions test/cctest/test-debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7834,8 +7834,8 @@ TEST(DebugPromiseInterceptedByTryCatch) {
CompileRun("var p = new Promise(function(res, rej) { fun(); res(); });");
CompileRun(
"var r;"
"p.chain(function() { r = 'resolved'; },"
" function() { r = 'rejected'; });");
"p.then(function() { r = 'resolved'; },"
" function() { r = 'rejected'; });");
CHECK(CompileRun("r")->Equals(context, v8_str("resolved")).FromJust());
}

Expand Down Expand Up @@ -7874,8 +7874,8 @@ TEST(DebugPromiseRejectedByCallback) {
CompileRun("var p = new Promise(function(res, rej) { fun(); res(); });");
CompileRun(
"var r;"
"p.chain(function() { r = 'resolved'; },"
" function(e) { r = 'rejected' + e; });");
"p.then(function() { r = 'resolved'; },"
" function(e) { r = 'rejected' + e; });");
CHECK(
CompileRun("r")->Equals(context, v8_str("rejectedrejection")).FromJust());
CHECK_EQ(1, exception_event_counter);
Expand Down

0 comments on commit fa16060

Please sign in to comment.