var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {
compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
+ if (self.left.has_side_effects(compressor)) {
+ return make_node(AST_Seq, self, {
+ car: self.left,
+ cdr: make_node(AST_False)
+ }).optimize(compressor);
+ }
return make_node(AST_False, self);
}
if (ll.length > 1 && ll[1]) {
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {
compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start);
+ if (self.left.has_side_effects(compressor)) {
+ return make_node(AST_Seq, self, {
+ car: self.left,
+ cdr: make_node(AST_True)
+ }).optimize(compressor);
+ }
return make_node(AST_True, self);
}
if (ll.length > 1 && !ll[1]) {