Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewPromiseCapability section has to be clear about GetCapabilitiesExecutor call #355

Closed
thefourtheye opened this issue Feb 4, 2016 · 1 comment

Comments

@thefourtheye
Copy link
Contributor

As it is, NewPromiseCapability section says

Let executor be a new built-in function object as defined in GetCapabilitiesExecutor Functions

but the GetCapabilitiesExecutor Functions is defined as

When a GetCapabilitiesExecutor function F is called with arguments resolve and reject the following steps are taken:

So, it is not very clear what the functions passed to GetCapabilitiesExecutor from NewPromiseCapability.

Can someone please explain?

@zenparsing
Copy link
Member

The purpose of GetCapabilitiesExecutor is to extract the resolve and reject functions from constructing a new promise and pack them into a PromiseCapability record. Think of it like this:

function makeGetCapabilitiesExecutor() {
    return function F(resolve, reject) {
        F._Capabilities.resolve = resolve;
        F._Capabilities.reject = reject;
    };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants