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

Unified Diff: src/js/promise.js

Issue 2161263003: [debug] use catch prediction flag for promise rejections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index 5e8c460ddfcaedfc7582b846c90e0f54b7f53ac8..cfaf7fb3fa328acbe23acf45bf3d2f0e1a6e0a8a 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -88,9 +88,9 @@ var GlobalPromise = function Promise(executor) {
var callbacks = CreateResolvingFunctions(promise);
var debug_is_active = DEBUG_IS_ACTIVE;
try {
- if (debug_is_active) %DebugPushPromise(promise, Promise);
+ if (debug_is_active) %DebugPushPromise(promise);
executor(callbacks.resolve, callbacks.reject);
- } catch (e) {
+ } %catch (e) { // Natives syntax to mark this catch block.
%_Call(callbacks.reject, UNDEFINED, e);
} finally {
if (debug_is_active) %DebugPopPromise();
@@ -157,10 +157,10 @@ function FulfillPromise(promise, status, value, promiseQueue) {
function PromiseHandle(value, handler, deferred) {
var debug_is_active = DEBUG_IS_ACTIVE;
try {
- if (debug_is_active) %DebugPushPromise(deferred.promise, PromiseHandle);
+ if (debug_is_active) %DebugPushPromise(deferred.promise);
var result = handler(value);
deferred.resolve(result);
- } catch (exception) {
+ } %catch (exception) { // Natives syntax to mark this catch block.
try { deferred.reject(exception); } catch (e) { }
} finally {
if (debug_is_active) %DebugPopPromise();

Powered by Google App Engine
This is Rietveld 408576698