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

Bug 448535

Summary: [Occurrences] Does not mark occurrence that happens in a nested scope BEFORE the declaration
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 445410    
Bug Blocks:    

Description Curtis Windatt CLA 2014-10-23 13:12:01 EDT
Cloning rather than reopening as the fix for this will be 8.0.

Possibly relating to other changes in finder.js, the occurrence inside of function h is not marked.

+++ This bug was initially created as a clone of Bug #445410 +++

f();
function g(){
  f();  // Not marked
}
function f(){}
function h(){
  f();
}
f();

No matter which occurrence of f is selected, the call inside of g() will not be marked.
Comment 1 Curtis Windatt CLA 2014-10-23 16:28:35 EDT
To reproduce you actually need a redefine in the program scope, which I had elsewhere in my test file.

var f;
f();
function g(){
  f();  // Not marked
}
function f(){}
function h(){
  f();
}
f();

The problem is that we clear any occurrences in nested scopes when we encounter the redefine, as we assume they belong to another defining node.  However, in this case, the nested call is a valid occurrence.  The solution is the same principle used in Bug 445410, rather than applying occurrences in nested scopes, we attempt to move them to the defining scope.  That way when we pop the defining scope only the occurrences 'belonging' to that defining node are used.

Fixed in master
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=d618324379e3e0ee0507b700509e95bc880746e2