4 ms·
Why is this discussion about semi-colon insertion and not about the use of short-circuiting as a replacement for specific 'if' statements and general inconsiste
by _rknLA 14y ago
Why is this discussion about semi-colon insertion and not about the use of short-circuiting as a replacement for specific 'if' statements and general inconsistency in the project?
https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js#L91 https://github.com/twitter/bootstrap/blob/master/js/bootstra...
https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js#L61 https://github.com/twitter/bootstrap/blob/master/js/bootstra...
(Incidentally, would lines 54/56 of bootstrap-modal suffer from the same problem? Or does the fact that the last function call on line 54 is already in an && expression change things)
I'm kind of surprised that the bug wasn't fixed by changing the line to `isActive || $parent.toggleClass('open')` as is done here https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js#L52 https://github.com/twitter/bootstrap/blob/master/js/bootstra...