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

Unified Diff: src/js/promise.js

Issue 2403163002: [promises] update comment about deferred reactions symbol state (Closed)
Patch Set: fix comment 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 86be06018ce7230dd54a9d7179db9dbd5fa365fa..4227a7efff5a5fd9c419b3b197948144e0251ef6 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -128,15 +128,10 @@ function PromiseSet(promise, status, value) {
SET_PRIVATE(promise, promiseFulfillReactionsSymbol, UNDEFINED);
SET_PRIVATE(promise, promiseRejectReactionsSymbol, UNDEFINED);
- // There are 2 possible states for this symbol --
- // 1) UNDEFINED -- This is the zero state, no deferred object is
- // attached to this symbol. When we want to add a new deferred we
- // directly attach it to this symbol.
- // 2) symbol with attached deferred object -- New deferred objects
- // are not attached to this symbol, but instead they are directly
- // attached to the resolve, reject callback arrays. At this point,
- // the deferred symbol's state is stale, and the deferreds should be
- // read from the reject, resolve callbacks.
+ // This symbol is used only when one deferred needs to be attached. When more
+ // than one deferred need to be attached the promise, we attach them directly
+ // to the promiseFulfillReactionsSymbol and promiseRejectReactionsSymbol and
+ // reset this back to UNDEFINED.
SET_PRIVATE(promise, promiseDeferredReactionsSymbol, UNDEFINED);
adamk 2016/10/10 19:19:32 Can you rename the symbol to match its usage? And
return promise;
« 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