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

Bug 452161

Summary: [Occurrences] Selecting a computed property does not mark occurrences
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2014-11-18 13:16:12 EST
Consider the following snippet

var f = {
	one: function(a) {
		var c = arr[a];
	}
}

select 'a' in the arr[a] expression. No occurrences are marked. If you select 'a' anywhere else occurrences are marked as expected.

Probably just not handling a computed property properly.

Computed properties take the form:

"init": {
  "type": "MemberExpression",
  "computed": true,
  "object": {
    "type": "Identifier",
    "name": "arr"
  },
  "property": {
    "type": "Identifier",
    "name": "a"
   }
}
Comment 1 Curtis Windatt CLA 2014-11-18 15:51:41 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=212277cb4fe7e226e5c3800639d69befbb8d0840
Fixed in master with tests

The identifier's parent is a member expression, so we assume we have an object property selected.  Fixed by checking if the parent is marked as computed.