mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 13:11:03 +00:00
Update std.js
This commit is contained in:
parent
1716fc19d5
commit
9de4fa64f8
16
lib/std.js
16
lib/std.js
|
@ -29,6 +29,7 @@ if (!Function.prototype.GetResource) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MS JScript Enumerator to Array
|
// MS JScript Enumerator to Array
|
||||||
|
/*
|
||||||
if (!Enumerator.prototype.toArray) {
|
if (!Enumerator.prototype.toArray) {
|
||||||
Enumerator.prototype.toArray = function() {
|
Enumerator.prototype.toArray = function() {
|
||||||
var a = [];
|
var a = [];
|
||||||
|
@ -61,6 +62,21 @@ if (!Enumerator.prototype.toArray) {
|
||||||
return a;
|
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
|
// Global APIs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user