mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-08 20:56:04 +00:00
Update std.js
This commit is contained in:
parent
388c0ae3d0
commit
a0f2d645e5
20
lib/std.js
20
lib/std.js
|
@ -398,9 +398,22 @@ StdEventTarget.__counter__ = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var a = new AsyncFunction(function() {
|
var a = new AsyncFunction(function() {
|
||||||
console.log("calling");
|
console.log("calling A");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var _async_b = function(function() {
|
||||||
|
console.log("calling B");
|
||||||
|
});
|
||||||
|
|
||||||
|
function main(args) {
|
||||||
|
AsyncFunction.bind(this, args);
|
||||||
|
console.log("welcome");
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.a = a;
|
||||||
|
exports._async_b = _async_b;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function AsyncFunction(f, __filename) {
|
function AsyncFunction(f, __filename) {
|
||||||
this.f = f;
|
this.f = f;
|
||||||
this.__filename = __filename;
|
this.__filename = __filename;
|
||||||
|
@ -445,14 +458,13 @@ AsyncFunction.bind = function(exports, args) {
|
||||||
exports[target](args);
|
exports[target](args);
|
||||||
result = true;
|
result = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Exception of AsyncFunction.bind", e.message);
|
console.error("Exception of", target, e.message);
|
||||||
result = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
throw new ReferenceError("AsyncFunction completed");
|
||||||
};
|
};
|
||||||
|
|
||||||
function GeneratorFunction(f, callback) {
|
function GeneratorFunction(f, callback) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user