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

contexta #JSCContext
executoran initialization callback

Returns

a deferred promise object