OLD | NEW |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 function PromiseInit(promise) { | 141 function PromiseInit(promise) { |
142 return PromiseSet(promise, kPending, UNDEFINED); | 142 return PromiseSet(promise, kPending, UNDEFINED); |
143 } | 143 } |
144 | 144 |
145 function FulfillPromise(promise, status, value, promiseQueue) { | 145 function FulfillPromise(promise, status, value, promiseQueue) { |
146 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) { | 146 if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) { |
147 var tasks = GET_PRIVATE(promise, promiseQueue); | 147 var tasks = GET_PRIVATE(promise, promiseQueue); |
148 if (!IS_UNDEFINED(tasks)) { | 148 if (!IS_UNDEFINED(tasks)) { |
149 var tasks = GET_PRIVATE(promise, promiseQueue); | |
150 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol); | 149 var deferreds = GET_PRIVATE(promise, promiseDeferredReactionsSymbol); |
151 PromiseEnqueue(value, tasks, deferreds, status); | 150 PromiseEnqueue(value, tasks, deferreds, status); |
152 } | 151 } |
153 PromiseSet(promise, status, value); | 152 PromiseSet(promise, status, value); |
154 } | 153 } |
155 } | 154 } |
156 | 155 |
157 function PromiseHandle(value, handler, deferred) { | 156 function PromiseHandle(value, handler, deferred) { |
158 var debug_is_active = DEBUG_IS_ACTIVE; | 157 var debug_is_active = DEBUG_IS_ACTIVE; |
159 try { | 158 try { |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 to.PromiseChain = PromiseChain; | 618 to.PromiseChain = PromiseChain; |
620 to.PromiseDefer = PromiseDefer; | 619 to.PromiseDefer = PromiseDefer; |
621 to.PromiseAccept = PromiseAccept; | 620 to.PromiseAccept = PromiseAccept; |
622 | 621 |
623 to.PromiseCreateRejected = PromiseCreateRejected; | 622 to.PromiseCreateRejected = PromiseCreateRejected; |
624 to.PromiseCreateResolved = PromiseCreateResolved; | 623 to.PromiseCreateResolved = PromiseCreateResolved; |
625 to.PromiseThen = PromiseThen; | 624 to.PromiseThen = PromiseThen; |
626 }); | 625 }); |
627 | 626 |
628 }) | 627 }) |
OLD | NEW |