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

Bug 489156

Summary: [quickfix] Fix for 'gratuitous parentheses' breaks code
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 11.0   
Target Milestone: 12.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2016-03-07 12:22:06 EST
Consider the following snippet:

if(typeof(config) === 'undefined') {
  config = Object.create(null);
}

if you use the fix it joins typeof and config, which breaks the code.
Comment 1 Olivier Thomann CLA 2016-03-07 12:39:08 EST
We actually need to insert a space instead of the opening parenthesis. So:
if(typeof(config) === 'undefined') {
  config = Object.create(null);
}
should become:
if(typeof config === 'undefined') {
  config = Object.create(null);
}
Working on it.
Comment 2 Olivier Thomann CLA 2016-03-07 14:11:39 EST
Interestingly we had an existing test case that was not expected the right result. It is similar to the test case in comment 0.
Comment 3 Olivier Thomann CLA 2016-03-07 14:42:19 EST
Fixed.