| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 }) |
| OLD | NEW |