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 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var InternalArray = utils.InternalArray; | 14 var InternalArray = utils.InternalArray; |
15 var promiseAsyncStackIDSymbol = | 15 var promiseAsyncStackIDSymbol = |
16 utils.ImportNow("promise_async_stack_id_symbol"); | 16 utils.ImportNow("promise_async_stack_id_symbol"); |
17 var promiseHandledBySymbol = | 17 var promiseHandledBySymbol = |
18 utils.ImportNow("promise_handled_by_symbol"); | 18 utils.ImportNow("promise_handled_by_symbol"); |
19 var promiseForwardingHandlerSymbol = | 19 var promiseForwardingHandlerSymbol = |
20 utils.ImportNow("promise_forwarding_handler_symbol"); | 20 utils.ImportNow("promise_forwarding_handler_symbol"); |
21 var promiseHandledHintSymbol = | 21 var promiseHandledHintSymbol = |
22 utils.ImportNow("promise_handled_hint_symbol"); | 22 utils.ImportNow("promise_handled_hint_symbol"); |
23 var promiseRawSymbol = utils.ImportNow("promise_raw_symbol"); | 23 var ObjectHasOwnProperty; // Used by HAS_PRIVATE. |
24 var promiseStateSymbol = utils.ImportNow("promise_state_symbol"); | |
25 var promiseResultSymbol = utils.ImportNow("promise_result_symbol"); | |
26 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | |
27 var ObjectHasOwnProperty; | |
28 var GlobalPromise = global.Promise; | 24 var GlobalPromise = global.Promise; |
29 var PromiseThen = GlobalPromise.prototype.then; | |
30 | 25 |
31 utils.Import(function(from) { | 26 utils.Import(function(from) { |
32 ObjectHasOwnProperty = from.ObjectHasOwnProperty; | 27 ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
33 }); | 28 }); |
34 | 29 |
35 // ------------------------------------------------------------------- | 30 // ------------------------------------------------------------------- |
36 | 31 |
37 // Core functionality. | 32 // Core functionality. |
38 | 33 |
39 function PromiseDebugGetInfo(deferreds, status) { | 34 function PromiseDebugGetInfo(deferreds, status) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // resolve/reject closures, and allows them to later resolve and reject any | 365 // resolve/reject closures, and allows them to later resolve and reject any |
371 // promise without having to hold on to those closures forever. | 366 // promise without having to hold on to those closures forever. |
372 utils.InstallFunctions(extrasUtils, 0, [ | 367 utils.InstallFunctions(extrasUtils, 0, [ |
373 "createPromise", PromiseCreate, | 368 "createPromise", PromiseCreate, |
374 "rejectPromise", DoRejectPromise, | 369 "rejectPromise", DoRejectPromise, |
375 "markPromiseAsHandled", MarkPromiseAsHandled | 370 "markPromiseAsHandled", MarkPromiseAsHandled |
376 ]); | 371 ]); |
377 | 372 |
378 utils.Export(function(to) { | 373 utils.Export(function(to) { |
379 to.PromiseCreate = PromiseCreate; | 374 to.PromiseCreate = PromiseCreate; |
380 to.PromiseThen = PromiseThen; | |
381 | 375 |
382 to.CreateInternalPromiseCapability = CreateInternalPromiseCapability; | 376 to.CreateInternalPromiseCapability = CreateInternalPromiseCapability; |
383 to.RejectPromise = RejectPromise; | 377 to.RejectPromise = RejectPromise; |
384 }); | 378 }); |
385 | 379 |
386 }) | 380 }) |
OLD | NEW |