javascripteclipseeclipse-jsdt

JSDT - Variable never read - bug or feature?


In eclipse using a JavaScript project i set the never-read-variable-scanner to "error" (Alt+wp, JavaScript->Validator->Errors/Warnings)

Now i habe the function "MyFunction"

function MyFunction() {
    var self = this;
    function getSelf() {
        return self;
    }
    return {
        getThis : +getSelf
    };
}

Everything works fine. But if i remove the + sign, its telling me self is never read.

Is it a bug or a feature and why?


Solution

  • It's maybe a BUG, try this code in other IDE and if this work, the problem is on eclipse