protect for in loops with hasOwnProperty
This commit is contained in:
@@ -127,14 +127,16 @@ OpenLayers.Tween = OpenLayers.Class({
|
||||
play: function() {
|
||||
var value = {};
|
||||
for (var i in this.begin) {
|
||||
var b = this.begin[i];
|
||||
var f = this.finish[i];
|
||||
if (b == null || f == null || isNaN(b) || isNaN(f)) {
|
||||
throw new TypeError('invalid value for Tween');
|
||||
}
|
||||
if (this.begin.hasOwnProperty(i)) {
|
||||
var b = this.begin[i];
|
||||
var f = this.finish[i];
|
||||
if (b == null || f == null || isNaN(b) || isNaN(f)) {
|
||||
throw new TypeError('invalid value for Tween');
|
||||
}
|
||||
|
||||
var c = f - b;
|
||||
value[i] = this.easing.apply(this, [this.time, b, c, this.duration]);
|
||||
var c = f - b;
|
||||
value[i] = this.easing.apply(this, [this.time, b, c, this.duration]);
|
||||
}
|
||||
}
|
||||
this.time++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user