mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 17:34:58 +00:00
Update task.js
This commit is contained in:
parent
15d33178c6
commit
02138ab366
27
lib/task.js
27
lib/task.js
|
@ -205,9 +205,36 @@ function setInterval(f, delay) {
|
|||
__taskQueue__.put(task);
|
||||
}
|
||||
|
||||
function Promise(executor) {
|
||||
this.length = 1;
|
||||
this.executor = executor;
|
||||
|
||||
this.all = function(iterable) {
|
||||
// todo
|
||||
};
|
||||
this.race = function(iterable) {
|
||||
// todo
|
||||
};
|
||||
this.reject = function(reason) {
|
||||
// todo
|
||||
};
|
||||
this.resolve = function(reason) {
|
||||
// todo
|
||||
};
|
||||
this.then = function(successCallback, failureCallback) {
|
||||
// todo
|
||||
};
|
||||
this.catch = function(failureCallback) {
|
||||
// todo
|
||||
};
|
||||
|
||||
this.executor(this.resolve, this.reject);
|
||||
}
|
||||
|
||||
exports.__taskQueue__ = __taskQueue__;
|
||||
exports.setTimeout = setTimeout;
|
||||
exports.setInterval = setInterval;
|
||||
exports.Promise = Promise;
|
||||
////////////////////////////////////////////////////
|
||||
// END Global functions
|
||||
////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue
Block a user