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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 deferred); | 209 deferred); |
210 | 210 |
211 SET_PRIVATE(promise, promiseFulfillReactionsSymbol, resolveCallbacks); | 211 SET_PRIVATE(promise, promiseFulfillReactionsSymbol, resolveCallbacks); |
212 SET_PRIVATE(promise, promiseRejectReactionsSymbol, rejectCallbacks); | 212 SET_PRIVATE(promise, promiseRejectReactionsSymbol, rejectCallbacks); |
213 } else { | 213 } else { |
214 maybeResolveCallbacks.push(onResolve, deferred); | 214 maybeResolveCallbacks.push(onResolve, deferred); |
215 GET_PRIVATE(promise, promiseRejectReactionsSymbol).push(onReject, deferred); | 215 GET_PRIVATE(promise, promiseRejectReactionsSymbol).push(onReject, deferred); |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 function PromiseIdResolveHandler(x) { return x } | 219 function PromiseIdResolveHandler(x) { return x; } |
220 function PromiseIdRejectHandler(r) { throw r } | 220 function PromiseIdRejectHandler(r) { %_ReThrow(r); } |
221 | 221 |
222 function PromiseNopResolver() {} | 222 function PromiseNopResolver() {} |
223 | 223 |
224 // ------------------------------------------------------------------- | 224 // ------------------------------------------------------------------- |
225 // Define exported functions. | 225 // Define exported functions. |
226 | 226 |
227 // For bootstrapper. | 227 // For bootstrapper. |
228 | 228 |
229 // ES#sec-ispromise IsPromise ( x ) | 229 // ES#sec-ispromise IsPromise ( x ) |
230 function IsPromise(x) { | 230 function IsPromise(x) { |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 utils.Export(function(to) { | 643 utils.Export(function(to) { |
644 to.PromiseCastResolved = PromiseCastResolved; | 644 to.PromiseCastResolved = PromiseCastResolved; |
645 to.PromiseThen = PromiseThen; | 645 to.PromiseThen = PromiseThen; |
646 | 646 |
647 to.GlobalPromise = GlobalPromise; | 647 to.GlobalPromise = GlobalPromise; |
648 to.NewPromiseCapability = NewPromiseCapability; | 648 to.NewPromiseCapability = NewPromiseCapability; |
649 to.PerformPromiseThen = PerformPromiseThen; | 649 to.PerformPromiseThen = PerformPromiseThen; |
650 }); | 650 }); |
651 | 651 |
652 }) | 652 }) |
OLD | NEW |