mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 21:21:03 +00:00
Update std.js
This commit is contained in:
parent
39ec21b9ba
commit
d5d5971ff1
10
lib/std.js
10
lib/std.js
|
@ -364,10 +364,9 @@ function StdEventableObject() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function AsyncFunction(f, _filename) {
|
||||||
function AsyncFunction(f, owner) {
|
|
||||||
this.f = f;
|
this.f = f;
|
||||||
this.owner = owner;
|
this._filename = _filename;
|
||||||
|
|
||||||
this.run = function() {
|
this.run = function() {
|
||||||
var args = Array.from(arguments);
|
var args = Array.from(arguments);
|
||||||
|
@ -384,7 +383,7 @@ function AsyncFunction(f, owner) {
|
||||||
|
|
||||||
// CLI or Window?
|
// CLI or Window?
|
||||||
if (typeof WScript !== "undefined") {
|
if (typeof WScript !== "undefined") {
|
||||||
require("lib/shell").show(["cscript", "app.js", this.owner, f].concat(args));
|
require("lib/shell").show(["cscript", "app.js", this._filename, f].concat(args));
|
||||||
} else {
|
} else {
|
||||||
sleep(1, _f);
|
sleep(1, _f);
|
||||||
}
|
}
|
||||||
|
@ -394,8 +393,7 @@ function AsyncFunction(f, owner) {
|
||||||
return this.f.apply(null, arguments);
|
return this.f.apply(null, arguments);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
AsyncFunction.counter = 0;
|
||||||
AsyncFunction.counter = 0; // static variable
|
|
||||||
AsyncFunction.bind = function(exports, args) {
|
AsyncFunction.bind = function(exports, args) {
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user