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

Side by Side Diff: src/js/promise.js

Issue 2016183002: Promises: cleanup call to PromiseSet (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 function PromiseCreateAndSet(status, value) { 122 function PromiseCreateAndSet(status, value) {
123 var promise = new GlobalPromise(promiseRawSymbol); 123 var promise = new GlobalPromise(promiseRawSymbol);
124 // If debug is active, notify about the newly created promise first. 124 // If debug is active, notify about the newly created promise first.
125 if (DEBUG_IS_ACTIVE) PromiseSet(promise, kPending, UNDEFINED); 125 if (DEBUG_IS_ACTIVE) PromiseSet(promise, kPending, UNDEFINED);
126 return PromiseSet(promise, status, value); 126 return PromiseSet(promise, status, value);
127 } 127 }
128 128
129 function PromiseInit(promise) { 129 function PromiseInit(promise) {
130 return PromiseSet( 130 return PromiseSet(promise, kPending, UNDEFINED);
131 promise, kPending, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED);
132 } 131 }
133 132
134 function FulfillPromise(promise, status, value, promiseQueue) { 133 function FulfillPromise(promise, status, value, promiseQueue) {
135 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) { 134 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) {
136 var tasks = GET_PRIVATE(promise, promiseQueue); 135 var tasks = GET_PRIVATE(promise, promiseQueue);
137 if (!IS_UNDEFINED(tasks)) { 136 if (!IS_UNDEFINED(tasks)) {
138 var tasks = GET_PRIVATE(promise, promiseQueue); 137 var tasks = GET_PRIVATE(promise, promiseQueue);
139 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol); 138 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol);
140 PromiseEnqueue(value, tasks, deferreds, status); 139 PromiseEnqueue(value, tasks, deferreds, status);
141 } 140 }
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 to.PromiseChain = PromiseChain; 575 to.PromiseChain = PromiseChain;
577 to.PromiseDefer = PromiseDefer; 576 to.PromiseDefer = PromiseDefer;
578 to.PromiseAccept = PromiseAccept; 577 to.PromiseAccept = PromiseAccept;
579 578
580 to.PromiseCreateRejected = PromiseCreateRejected; 579 to.PromiseCreateRejected = PromiseCreateRejected;
581 to.PromiseCreateResolved = PromiseCreateResolved; 580 to.PromiseCreateResolved = PromiseCreateResolved;
582 to.PromiseThen = PromiseThen; 581 to.PromiseThen = PromiseThen;
583 }); 582 });
584 583
585 }) 584 })
OLDNEW
« 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