The update method has weird logic (see below). Moreover, it does not return this, as suggested in the documentation. If you want to keep setter and getter merged, you could test for arguments.length === 0 to return the property and this otherwise.
update: function(redraw){
if (redraw === true)
this._redrawEnabled = false;
if (redraw === false)
this._redrawEnabled = true;
return !!this._redrawEnabled;
},
This simplifies to this._redrawEnabled = !redraw, which seems wrong.
The
updatemethod has weird logic (see below). Moreover, it does not returnthis, as suggested in the documentation. If you want to keep setter and getter merged, you could test forarguments.length === 0to return the property andthisotherwise.This simplifies to
this._redrawEnabled = !redraw, which seems wrong.