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

Projects
None yet
3 participants
@thefourtheye
Contributor

thefourtheye commented Feb 4, 2016

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

This comment has been minimized.

Show comment
Hide comment
@zenparsing

zenparsing Feb 4, 2016

Contributor

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;
    };
}
Contributor

zenparsing commented Feb 4, 2016

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