Value.newPromise

Creates a new Promise. executor will be invoked during promise initialization and it receives the resolve and reject objects than can be called to resolve or reject the promise. It is called like a JavaScript function, so exceptions raised during the executor invocation will not be propagated to the context, but handled by the promise causing a rejection.

Parameters

context javascriptcore.context.Context

a #JSCContext

executor javascriptcore.types.Executor

an initialization callback

Return Value

Type: javascriptcore.value.Value

a deferred promise object