-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
In #18, I propose letting the factory run in a new event loop turn. This parallels assimilation, which must be done in the next turn for integrity reasons. Nevertheless, it's not necessary for the constructor; we could have assimilation do a next-turn call to the constructor.
Note that this doesn't prevent building deferreds from the promise constructor, but it does make them more awkward:
function defer() {
var resolve;
var reject;
var promise = new Promise(function (resolveArg, rejectArg) {
resolve = resolveArg;
reject = rejectArg;
});
return {
promise: promise,
resolve: function (x) {
nextTick(function () { resolve(x); });
},
reject: function (reason) {
nextTick(function () { reject(reason); });
}
};
}Metadata
Metadata
Assignees
Labels
No labels