Update std.js

This commit is contained in:
Namhyeon Go 2022-01-19 16:31:49 +09:00 committed by GitHub
parent 3d71c4d5bc
commit fe075354fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
// Polyfills // Polyfills
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
if (!Function.prototype.GetResource) { if (!Function.prototype.GetResource) {
Function.prototype.GetResource = function(ResourceName) { Function.prototype.GetResource = function(ResourceName) {
if (!this.Resources) { if (!this.Resources) {
@ -29,14 +30,17 @@ if (!Function.prototype.GetResource) {
if (!Enumerator.prototype.toArray) { if (!Enumerator.prototype.toArray) {
Enumerator.prototype.toArray = function() { Enumerator.prototype.toArray = function() {
var items = []; var a = [];
for (; !this.atEnd(); this.moveNext()) { for (; !this.atEnd(); this.moveNext()) {
var item = this.item(); var x = {};
try { var b = new Enumerator(this.item().Properties_);
items.push(item); for (; !b.atEnd(); b.moveNext()) {
} catch (e) {} var c = b.item();
x[c.name] = c.value;
}
a.push(x);
} }
return items; return a;
}; };
} }