From 6ab0343834c07096c8a8f454b57465e1246716be Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 10 Mar 2023 17:47:18 +0900 Subject: [PATCH] Update std.js --- lib/std.js | 50 +------------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/lib/std.js b/lib/std.js index 54c4d59..c4ec7d4 100644 --- a/lib/std.js +++ b/lib/std.js @@ -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;