| Summary: | [validation] False "variable is never read" warning with certain variable names | ||
|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Klaus Reimer <k> |
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Chris Jaun <cmjaun> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This is working correctly in WTP 3.5.1. Checked against 7/18 build. |
Build Identifier: I20110613-1736 The following small code generates a "variable location is never read" warning which is wrong because the variable IS read. function test() { var location; location = { foo: 42 }; return location.foo; } Interesting facts: 1. It does NOT happen when returning location["foo"] instead of location.foo. 2. It does NOT happen when using a different variable name. It is reproducible with "location" and "window" and "document" (and may be others) but not with variable names which doesn't collide with pre-defined top-level variables. So maybe this warning collides with the "hides another field or variable" warning? But I couldn't reproduce it with a custom variable name which is also defined in the global scope. Reproducible: Always