| Summary: | [quickfix] Fix for 'gratuitous parentheses' breaks code | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | 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: | |||
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.
Interestingly we had an existing test case that was not expected the right result. It is similar to the test case in comment 0. Fixed. |
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.