captainbrosset/cleanjs — Issue #44: Class property reported as unused in some cases
Author: captainbrosset
Created: 2012-02-21 14:38:20+00:00
State: open
Labels: bug

Class property usage is not reported correctly in this case:

function Test() {
this.property = 1;
};
Test.prototype.doSomething = function() {
var p = this.property, a = 2;
return p + a;
};

Report here: http://cleanjscode.appspot.com/MTE5

However, in this case:

function Test() {
this.property = 1;
};
Test.prototype.doSomething = function() {
var p = this.property;
return p + a;
};

It works well: http://cleanjscode.appspot.com/MTIw