Update std.js

This commit is contained in:
Namhyeon Go 2024-08-06 21:30:31 +09:00 committed by GitHub
parent ca6f13196d
commit 3ff02c442e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -430,6 +430,15 @@ function AsyncFunction(f, __filename) {
this.runSynchronously = function() {
return this.f.apply(null, arguments);
};
if (typeof this.__filename === "string") {
this.__filename = __filename;
} else if (typeof WScript !== "undefined") {
this.__filename = (function(path) {
var pos = Math.max.apply(null, [path.lastIndexOf("\\"), path.lastIndexOf("/")]);
return (pos > -1 ? path.substring(pos + 1) : "");
})(WScript.ScriptFullName);
}
};
AsyncFunction.counter = 0;
AsyncFunction.bind = function(exports, args) {