File tree Expand file tree Collapse file tree 1 file changed +36
-2
lines changed
test/com/google/javascript/jscomp Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Original file line number Diff line number Diff line change 41
41
42
42
/**
43
43
* Unit tests for {@link ExpressionDecomposer}
44
- *
45
- * @author [email protected] (John Lenz)
46
44
*/
47
45
// Note: functions "foo" and "goo" are external functions in the helper.
48
46
@ RunWith (JUnit4 .class )
@@ -630,6 +628,42 @@ public void testExposeExpression6() {
630
628
"if (goo()) foo();" );
631
629
}
632
630
631
+ @ Test
632
+ public void testExposeDoubleAndExpression () {
633
+ helperExposeExpression (
634
+ "a = boo() && goo() && foo()" ,
635
+ "foo" ,
636
+ lines (
637
+ "var temp$jscomp$0;" ,
638
+ "if (temp$jscomp$0 = boo() && goo()) {" ,
639
+ " temp$jscomp$0 = foo();" ,
640
+ "}" ,
641
+ "a = temp$jscomp$0;" ,
642
+ "" ));
643
+ }
644
+
645
+ @ Test
646
+ public void testExposeDoubleHookExpression () {
647
+ helperExposeExpression (
648
+ "a = boo() ? void 0 : goo() ? void 0 : foo()" ,
649
+ "foo" ,
650
+ lines (
651
+ "var temp$jscomp$0;" ,
652
+ "if (boo()) {" ,
653
+ " temp$jscomp$0 = void 0;" ,
654
+ "} else {" ,
655
+ " var temp$jscomp$1;" ,
656
+ " if (goo()) {" ,
657
+ " temp$jscomp$1 = void 0;" ,
658
+ " } else {" ,
659
+ " temp$jscomp$1 = foo();" ,
660
+ " }" ,
661
+ " temp$jscomp$0 = temp$jscomp$1;" ,
662
+ "}" ,
663
+ "a = temp$jscomp$0;" ,
664
+ "" ));
665
+ }
666
+
633
667
@ Test
634
668
public void exposeExpressionNullishCoalesceNoResult () {
635
669
helperExposeExpression (
You can’t perform that action at this time.
0 commit comments