I have this piece of code in a constructor function:
Object.defineProperty(this, "color", {
get : function() {
return color;
},
set : function(newVal) {
color = newVal;
this.path.attr("stroke", color);
}
});
JSHint is warning that 'color' is not defined. Am I supposed to define 'color' somehow before configuring it with defineProperty?
(I have tried using 'this.color' inside defineProperty, but that causes infinite loops)
thanks