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

Unified Diff: src/js/promise.js

Issue 2446113007: [promises] remove kPending check in RejectPromise (Closed)
Patch Set: fmt Created 4 years, 2 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 | no next file » | 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 fb3a3d78cf2800adf4768c84395190f842150447..93758caf9513b4bb3db8889ef6cf44cd0d750ca8 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -302,18 +302,15 @@ function ResolvePromise(promise, resolution) {
// ES#sec-rejectpromise
// RejectPromise ( promise, reason )
function RejectPromise(promise, reason, debugEvent) {
- // Check promise status to confirm that this reject has an effect.
// Call runtime for callbacks to the debugger or for unhandled reject.
// The debugEvent parameter sets whether a debug ExceptionEvent should
// be triggered. It should be set to false when forwarding a rejection
// rather than creating a new one.
- if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) {
- // This check is redundant with checks in the runtime, but it may help
- // avoid unnecessary runtime calls.
- if ((debugEvent && DEBUG_IS_ACTIVE) ||
- !HAS_DEFINED_PRIVATE(promise, promiseHasHandlerSymbol)) {
- %PromiseRejectEvent(promise, reason, debugEvent);
- }
+ // This check is redundant with checks in the runtime, but it may help
+ // avoid unnecessary runtime calls.
+ if ((debugEvent && DEBUG_IS_ACTIVE) ||
+ !HAS_DEFINED_PRIVATE(promise, promiseHasHandlerSymbol)) {
+ %PromiseRejectEvent(promise, reason, debugEvent);
}
%PromiseFulfill(promise, kRejected, reason, promiseRejectReactionsSymbol)
PromiseSet(promise, kRejected, reason);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698