summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/util.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/lib/util.js b/scripts/lib/util.js
index c51a5bc4..c6836f72 100644
--- a/scripts/lib/util.js
+++ b/scripts/lib/util.js
@@ -11,4 +11,14 @@
}
});
Object.freeze(util);
+ if (Object.prototype.forEach === undefined) {
+ Object.defineProperty(Object.prototype, "forEach", {
+ value : function (callback) {
+ var key;
+ for (key in this) {
+ callback(key, this[key], this);
+ }
+ }
+ });
+ }
})();