0

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?

Grim
  • 1,938
  • 10
  • 56
  • 123

1 Answers1

0

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

Italo José
  • 1,558
  • 1
  • 17
  • 50
  • Id created a bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=464805 this will proove your answer the best i think. – Grim Apr 16 '15 at 14:42