Update std.js

This commit is contained in:
Namhyeon Go 2023-03-14 14:13:22 +09:00 committed by GitHub
parent 388c0ae3d0
commit a0f2d645e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {