| Summary: | Global variables declared inside functions are not discovered | ||
|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Jim Zhang <jzhang> |
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | Nitin Dahyabhai <thatnitind> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cmjaun |
| Version: | unspecified | ||
| Target Milestone: | 3.2.3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Jim Zhang
I did a little more research. I suspect this is how JSDT supports global variable discovery: 1. when something is declared "in the clear" with a "var" qualifier, it's picked up as a global variable. for instance in a js file I just declare var globalVar = ""; it shows up in the project explorer as a global variable. 2. if instead the same variable was declared without a "var" qualifier, although semantically it's equivalent to #1, JSDT does not discover it. 3. if I'm declaring a global variable "in the clear", I will have the option of always putting "var" in front and life is good. however if I'm doing this inside a function, the only way to declare a global variable is to not put the "var" in front, otherwise it becomes a local variable in the function's scope. In essence, the problem is not so much with anonymous functions, but that global variables declared inside functions are not being discovered. Pretty sure this is a duplicate of BUG311643. It was a similar problem where global variables were not being discovered. *** This bug has been marked as a duplicate of bug 311643 *** |