Update std.js

This commit is contained in:
Namhyeon Go 2023-03-10 17:47:18 +09:00 committed by GitHub
parent 6abe48ba5a
commit 6ab0343834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,54 +449,6 @@ AsyncFunction.bind = function(exports, args) {
return result;
};
function GeneratorFunction(f, callback) {
this._f = f;
this._callback = callback;
this._nextState = 0;
this._state = 0;
this._value = undefined;
this._done = false;
this._yield = function(value) {
if (this._nextState < this._state) {
throw new ReferenceError("CONTINUE");
} else {
this._value = value;
this._state++;
throw new ReferenceError("BREAK");
}
throw new RangeError("OUT OF RANGE");
};
this.next = function() {
this._nextState = 0;
var go = true;
while (go) {
try {
this._f(this._yield);
} catch (e) {
go = (e.message == "CONTINUE");
this._nextState++;
}
}
this._done = (typeof this._callback !== "undefined" ? this._callback(this) : false);
return {
value: this._value,
done: this._done
};
};
this['return'] = function() {
// Not implemented
};
this['throw'] = function() {
// Not implemented
};
}
function GeneratorFunction(f, callback) {
this._f = f;
this._callback = callback;
@ -565,7 +517,7 @@ global.splitLn = splitLn;
global.addslashes = addslashes;
global.AsyncFunction = AsyncFunction;
exports.VERSIONINFO = "Standard Library (std.js) version 0.8";
exports.VERSIONINFO = "Standard Library (std.js) version 0.8.1";
exports.global = global;
exports.require = global.require;