Commit fa160602 authored by littledan's avatar littledan Committed by Commit bot

Unship V8 custom Promise methods

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}
parent bdf8dc42
......@@ -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)
......
......@@ -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());
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment