gskinner/EaselJS — Issue #118: check hasOwnProperty when iterating over properties
Author: akonsu
Created: 2012-02-27 05:37:31+00:00
State: open

Please add a check for `hasOwnProperty` after line
https://github.com/gskinner/EaselJS/blob/master/src/easeljs/display/SpriteSheet.js#L247, and possibly in other similar places, when iterating over object's properties, because `Object.prototype` can define custom properties:

```
diff --git a/src/easeljs/display/SpriteSheet.js b/src/easeljs/display/SpriteSheet.js
index af868f5..5110ae5 100644
--- a/src/easeljs/display/SpriteSheet.js
+++ b/src/easeljs/display/SpriteSheet.js
@@ -245,6 +245,7 @@ var p = SpriteSheet.prototype;
this._data = {};
var name;
for (name in o) {
+	if (o.hasOwnProperty(name)) {
var anim = {name:name};
var obj = o[name];
if (!isNaN(obj)) { // single frame
@@ -267,6 +268,7 @@ var p = SpriteSheet.prototype;
this._data[name] = anim;
}
}
+	}

}