| Summary: | [Occurrences] When marking global occurrences we mark defining occurrences | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Curtis Windatt <curtis.windatt.public> |
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 6.0 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
This goes beyond the logic for just global occurrences. If we add a define for reDef() after the last line, the problem still occurs. If we move the define to the top, everything behaves correctly. var a = function reDef(){ reDef(); }; var reDef; reDef();
An example for non-global scope problem. When selecting the last reDef we mark all four occurrences, even though we should skip the first two as they are defining instances inside a different scope than the selection.
|
We have test case for the following: var a = function reDef() { var b = function reDef(){}; }; reDef(); If the first reDef is selected - one occurrence on the selection If the second reDef is selected - one occurrence on the selection If the third reDef is selected - all 3 occurrences selected? The same applies for a similar func decl test. When we don't have a defining node, we mark all occurrences globally. However, we shouldn't mark redefines or occurrences in scopes with redefines.