mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +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
|
||||
/*
|
||||
if (!Enumerator.prototype.toArray) {
|
||||
Enumerator.prototype.toArray = function() {
|
||||
var a = [];
|
||||
|
@ -61,6 +62,21 @@ 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
|
||||
|
|
Loading…
Reference in New Issue
Block a user