Mauro Bringolf aa684d1b0c Spec compliancy of check-es2015-constants plugin (#5930)
* Figuring out where to place throw statement

* Restored path argument destructuring

* New approach using comma expressions for assignments

* Moved throwNode into body of forXstatements

* Refactored with helper function and ensureBlock, additional tests for update exprs

* Added exec tests for all violations

* Hoisted helper function for comma expression outside of visitor
2017-07-17 20:01:01 -04:00

10 lines
160 B
JavaScript

function f() {
const a = "foo";
if (false) a = "false";
return a;
}
assert.equal(f(), "foo", 'Const violation in not taken branch should be ignored.')