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

Bug 490937

Summary: invalid 'Expected a conditional expression and instead saw an assignment' error
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: JS ToolsAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 12.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Grant Gayed CLA 2016-04-01 14:17:12 EDT
Minimal snippet that shows the problem, the following should be valid (assign b to a then check for truthiness) but is marked as an error:

var a; var b=1; if (a=b) {}
Comment 1 Curtis Windatt CLA 2016-04-04 16:01:54 EDT
Syntactically valid, but it is marked as an error because it is a potential programming problem.
http://eslint.org/docs/rules/no-cond-assign

Closing as INVALID.  We should strongly discourage this pattern, but the option can be turned off under JavaScript Validation settings.