Update std.js

This commit is contained in:
Namhyeon Go 2022-02-08 18:10:10 +09:00 committed by GitHub
parent cfb434d1c0
commit 3b157000f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@
/////////////////////////////////////////////////////////////////////////////////
// Polyfills
/////////////////////////////////////////////////////////////////////////////////
if (!Function.prototype.GetResource) {
Function.prototype.GetResource = function(ResourceName) {
if (!this.Resources) {
@ -28,37 +27,16 @@ if (!Function.prototype.GetResource) {
}
}
// MS JScript Enumerator to Array
if (!Enumerator.prototype.toArray) {
Enumerator.prototype.toArray = function() {
var a = [];
var items = [];
for (; !this.atEnd(); this.moveNext()) {
var x = {};
var b = new Enumerator(this.item().Properties_);
for (; !b.atEnd(); b.moveNext()) {
var c = b.item();
if (typeof c.value !== "unknown") {
var item = this.item();
try {
x[c.name] = c.value.toString();
} catch (e) {
x[c.name] = c.value;
items.push(item);
} catch (e) {}
}
} else {
var i = 0, d = [];
while (true) {
try {
d.push(c.value(i));
i++;
} catch (e) {
break;
}
}
x[c.name] = d;
}
}
a.push(x);
}
return a;
return items;
};
}