Missed short-circuiting
marccarigiet opened this issue · 2 comments
marccarigiet commented
- OS: Ubuntu 20.04 (x86)
- Revision [2141345]
describe the Bug
Expressions of the form: (expression evaluating to false ) && exp1 | exp2, don't short circuit,
Test case
function throwError() {
throw new Error();
}
false && true | throwError()
Or in a smaller case:
false && true | var1
backtrace
Uncaught Error:
biggercase.js (3:11)
biggercase.js (5:17)
and respectively
Uncaught ReferenceError: var1 is not defined:
trigger.js (1:17)
Expected behaviorNo error should be thrown, as the && operator should short-circuit and the parts of the expression throwing an error should not be evaluated.
ksh8281 commented
Thank you for your bug report