What steps will reproduce the problem?
var abc = new MVCObject;
abc.property = null;
abc.property_changed = function() { console.log('triggered'); };
abc.set('property', 'value1');
> triggered
abc.property_changed = null;
abc.set('property', 'value2');
> "TypeError: Property 'property_changed' of object #<MVCObject> is not a
function" from line ~225
I expect no error when my callback is null. Instead I get an error that
basically says the code tried to run "null".
Using latest version 0.21. By replacing the following line:
if(key + '_changed' in this) this[key + '_changed']();
with this:
if(typeof this[key + '_changed'] === 'function') this[key + '_changed']();
I was able to fix the error. Also verified that an actual observer function
there will run.
Cheers,
Dave
Original issue reported on code.google.com by dcporter@gmail.com on 26 Jan 2013 at 1:07
Original issue reported on code.google.com by
dcporter@gmail.com
on 26 Jan 2013 at 1:07