Value.newPromise
javascriptcore.value.Value newPromise(javascriptcore.context.Context context, javascriptcore.types.Executor executor)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 | a #JSCContext |
executor | an initialization callback |
Returns
a deferred promise object