Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 447962

Summary: [Occurrences] When marking global occurrences we mark defining occurrences
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: JS ToolsAssignee: 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:

Description Curtis Windatt CLA 2014-10-20 12:35:17 EDT
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.
Comment 1 Curtis Windatt CLA 2014-10-20 14:34:49 EDT
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.
Comment 2 Curtis Windatt CLA 2014-10-23 13:34:31 EDT
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.