| Index: src/js/promise.js
|
| diff --git a/src/js/promise.js b/src/js/promise.js
|
| index 9bf378025f48504f8e25e65923e5344846138391..0f10f80d5046e360fafb57b6e5e19ad5c7d3e602 100644
|
| --- a/src/js/promise.js
|
| +++ b/src/js/promise.js
|
| @@ -31,7 +31,7 @@ utils.Import(function(from) {
|
|
|
| // Core functionality.
|
|
|
| -function PromiseDebugGetInfo(deferreds, status) {
|
| +function PromiseDebugGetInfo(deferred_promise, status) {
|
| var id, name, instrumenting = DEBUG_IS_ACTIVE;
|
|
|
| if (instrumenting) {
|
| @@ -41,11 +41,11 @@ function PromiseDebugGetInfo(deferreds, status) {
|
| // functions will not get a good stack trace, as async functions require
|
| // different stacks from direct Promise use, but we save and restore a
|
| // stack once for all reactions. TODO(littledan): Improve this case.
|
| - if (!IS_UNDEFINED(deferreds) &&
|
| - HAS_PRIVATE(deferreds.promise, promiseHandledBySymbol) &&
|
| - HAS_PRIVATE(GET_PRIVATE(deferreds.promise, promiseHandledBySymbol),
|
| + if (!IS_UNDEFINED(deferred_promise) &&
|
| + HAS_PRIVATE(deferred_promise, promiseHandledBySymbol) &&
|
| + HAS_PRIVATE(GET_PRIVATE(deferred_promise, promiseHandledBySymbol),
|
| promiseAsyncStackIDSymbol)) {
|
| - id = GET_PRIVATE(GET_PRIVATE(deferreds.promise, promiseHandledBySymbol),
|
| + id = GET_PRIVATE(GET_PRIVATE(deferred_promise, promiseHandledBySymbol),
|
| promiseAsyncStackIDSymbol);
|
| name = "async function";
|
| } else {
|
| @@ -67,8 +67,8 @@ SET_PRIVATE(PromiseIdRejectHandler, promiseForwardingHandlerSymbol, true);
|
| // For bootstrapper.
|
|
|
| // This is used by utils and v8-extras.
|
| -function PromiseCreate() {
|
| - return %promise_internal_constructor(UNDEFINED);
|
| +function PromiseCreate(parent) {
|
| + return %promise_internal_constructor(parent);
|
| }
|
|
|
| // Only used by async-await.js
|
| @@ -81,17 +81,6 @@ function DoRejectPromise(promise, reason) {
|
| %PromiseReject(promise, reason, true);
|
| }
|
|
|
| -// The resultCapability.promise is only ever fulfilled internally,
|
| -// so we don't need the closures to protect against accidentally
|
| -// calling them multiple times.
|
| -function CreateInternalPromiseCapability(parent) {
|
| - return {
|
| - promise: %promise_internal_constructor(parent),
|
| - resolve: UNDEFINED,
|
| - reject: UNDEFINED
|
| - };
|
| -}
|
| -
|
| // ES#sec-newpromisecapability
|
| // NewPromiseCapability ( C )
|
| function NewPromiseCapability(C, debugEvent) {
|
| @@ -266,7 +255,7 @@ function PromiseRace(iterable) {
|
|
|
| // Utility for debugger
|
|
|
| -function PromiseHasUserDefinedRejectHandlerCheck(handler, deferred) {
|
| +function PromiseHasUserDefinedRejectHandlerCheck(handler, deferred_promise) {
|
| // Recurse to the forwarding Promise, if any. This may be due to
|
| // - await reaction forwarding to the throwaway Promise, which has
|
| // a dependency edge to the outer Promise.
|
| @@ -274,7 +263,7 @@ function PromiseHasUserDefinedRejectHandlerCheck(handler, deferred) {
|
| // - Promise.all/Promise.race forwarding to a throwaway Promise, which
|
| // has a dependency edge to the generated outer Promise.
|
| if (GET_PRIVATE(handler, promiseForwardingHandlerSymbol)) {
|
| - return PromiseHasUserDefinedRejectHandlerRecursive(deferred.promise);
|
| + return PromiseHasUserDefinedRejectHandlerRecursive(deferred_promise);
|
| }
|
|
|
| // Otherwise, this is a real reject handler for the Promise
|
| @@ -347,7 +336,6 @@ utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
|
| "promise_internal_reject", RejectPromise,
|
| "promise_debug_get_info", PromiseDebugGetInfo,
|
| "new_promise_capability", NewPromiseCapability,
|
| - "internal_promise_capability", CreateInternalPromiseCapability,
|
| "promise_id_resolve_handler", PromiseIdResolveHandler,
|
| "promise_id_reject_handler", PromiseIdRejectHandler
|
| ]);
|
| @@ -364,7 +352,6 @@ utils.InstallFunctions(extrasUtils, 0, [
|
| utils.Export(function(to) {
|
| to.PromiseCreate = PromiseCreate;
|
|
|
| - to.CreateInternalPromiseCapability = CreateInternalPromiseCapability;
|
| to.RejectPromise = RejectPromise;
|
| });
|
|
|
|
|