=== on 16 Mar 2015, 13:31:43 Pierre-Yves Nicolas wrote:
Raising issues on "return i{plus}{plus}" would lead to false positives because variable i can be referenced and used by other places in the code: it could be an object property and it could also be referenced by a closure.
=== on 16 Mar 2015, 14:34:31 Ann Campbell wrote:
I'm confused, [~pierre-yves.nicolas]. The original code examples showed post-incrementing a method-scope var...?
=== on 16 Mar 2015, 14:46:43 Pierre-Yves Nicolas wrote:
\[~ann.campbell.2]: the following example illustrates the case of a closure which keeps a reference on a variable:
----
function f(x) {
var i = 0;
x.y = function () { return i; };
return i++;
}
var z = {};
f(z); // 0
z.y(); // 1
----
I don't think we can currently raise issues on "return i{plus}{plus};" without false positives.