apsavin/jCanvaScript — pull request #10 by amaduki (2012-08-04 05:52:32+00:00)
Title: correcting addObject parameter check

Ther is a bug in addObject parameter check.

If some of some of args indicate boolean false when calling object, the arguments are treated as 'not defined' and overwrited by default value.

from public.js line 17-28
protoItem.base=function(name,parameters,args)
{
protoItem.prototype.base.call(this,parameters);
var i=0;
for(var key in parameters)
{
// if args[i] has value 'boolean false', it's overwrited by parameters[key]
// must be checked by code (args[i] !== undefined)?args[i] :parameters[key]

this['_'+key] = args[i] || parameters[key];
if(key=='color')this.color(args[i] || parameters[key];);
i++;
}
return this;
};