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

Bug 424149

Summary: String identifiers in object expressions are failing signature resultion
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, mamacdon
Version: unspecified   
Target Milestone: 5.0 M2   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2013-12-16 11:36:19 EST
Consider the following snippet:

var Baz = {
	"one": function() {
		return 'one';
	},
	
	"two": function() {
		return {
			"one" : Baz,
			"Two" : Baz
		}
	}
};

When outlined the two properties in the return object are named 'Anonymous Property' which is the absolute failure fall back for naming.
Comment 1 Michael Rennie CLA 2013-12-16 11:46:16 EST
The difference is there is a literal node the signatures class was not expecting:

"type": "Property",
  "key": {
    "type": "Literal",
    "value": "one",
    "raw": "'one'"
},

Vs.

"type": "Property",
 "key": {
    "type": "Identifier",
    "name": "one"
},
Comment 2 Michael Rennie CLA 2013-12-16 23:30:58 EST
Pushed fix + tests to Gerrit: https://git.eclipse.org/r/19889
Comment 3 Mark Macdonald CLA 2013-12-17 11:51:33 EST
.