diff --git a/lib/std.js b/lib/std.js index 9acefe7..251917b 100644 --- a/lib/std.js +++ b/lib/std.js @@ -28,10 +28,21 @@ if (!Function.prototype.GetResource) { } } -// MS JScript Enumerator to Array -/* if (!Enumerator.prototype.toArray) { Enumerator.prototype.toArray = function() { + var items = []; + for (; !this.atEnd(); this.moveNext()) { + var item = this.item(); + try { + items.push(item); + } catch (e) {} + } + return items; + }; +} + +if (!Enumerator.prototype.toArray2) { + Enumerator.prototype.toArray2 = function() { var a = []; for (; !this.atEnd(); this.moveNext()) { var x = {}; @@ -62,21 +73,6 @@ if (!Enumerator.prototype.toArray) { return a; }; } -*/ - -// old version -if (!Enumerator.prototype.toArray) { - Enumerator.prototype.toArray = function() { - var items = []; - for (; !this.atEnd(); this.moveNext()) { - var item = this.item(); - try { - items.push(item); - } catch (e) {} - } - return items; - }; -} ///////////////////////////////////////////////////////////////////////////////// // Global APIs