Simplify PathStyle#initialize().

This commit is contained in:
Jürg Lehni 2011-05-16 19:20:32 +01:00
parent 34110fa82d
commit 05c0eb0e51

View file

@ -29,15 +29,13 @@ var PathStyle = this.PathStyle = Base.extend(new function() {
beans: true,
initialize: function(style) {
if (style) {
// Note: This relies on bean setters that get implicetly
// called when setting values on this[key].
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i],
value = style[key];
if (value !== undefined)
this[key] = value;
}
// Note: This relies on bean setters that get implicetly
// called when setting values on this[key].
for (var i = 0, l = style && keys.length; i < l; i++) {
var key = keys[i],
value = style[key];
if (value !== undefined)
this[key] = value;
}
},