Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: src/js/promise.js

Issue 2350363002: Make Promise.all/Promise.race catch prediction conditional on DevTools (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-promises/promise-all-uncaught.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index 96afbc2dfbf2839d2a9dbdc87b206c284bd0b3e9..a7ba69e491968211d5d61cc4ba96300f0a48f09e 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -480,7 +480,10 @@ function PromiseAll(iterable) {
// For catch prediction, don't treat the .then calls as handling it;
// instead, recurse outwards.
- SET_PRIVATE(deferred.reject, promiseForwardingHandlerSymbol, true);
+ var instrumenting = DEBUG_IS_ACTIVE;
+ if (instrumenting) {
+ SET_PRIVATE(deferred.reject, promiseForwardingHandlerSymbol, true);
+ }
function CreateResolveElementFunction(index, values, promiseCapability) {
var alreadyCalled = false;
@@ -507,7 +510,7 @@ function PromiseAll(iterable) {
deferred.reject);
// For catch prediction, mark that rejections here are semantically
// handled by the combined Promise.
- if (IsPromise(throwawayPromise)) {
+ if (instrumenting && IsPromise(throwawayPromise)) {
SET_PRIVATE(throwawayPromise, promiseHandledBySymbol, deferred.promise);
}
++i;
@@ -539,7 +542,10 @@ function PromiseRace(iterable) {
// For catch prediction, don't treat the .then calls as handling it;
// instead, recurse outwards.
- SET_PRIVATE(deferred.reject, promiseForwardingHandlerSymbol, true);
+ var instrumenting = DEBUG_IS_ACTIVE;
+ if (instrumenting) {
+ SET_PRIVATE(deferred.reject, promiseForwardingHandlerSymbol, true);
+ }
try {
for (var value of iterable) {
@@ -547,7 +553,7 @@ function PromiseRace(iterable) {
deferred.reject);
// For catch prediction, mark that rejections here are semantically
// handled by the combined Promise.
- if (IsPromise(throwawayPromise)) {
+ if (instrumenting && IsPromise(throwawayPromise)) {
SET_PRIVATE(throwawayPromise, promiseHandledBySymbol, deferred.promise);
}
}
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-promises/promise-all-uncaught.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698