test/com/google/javascript/jscomp/integration/AdvancedOptimizationsIntegrationTest.java
/**
   * Make sure this doesn't compile to code containing
   *
   * <pre>a: break a;</pre>
   *
   * which doesn't work properly on some versions of Edge. See b/72667630.
   */
Make sure this doesn't compile to code containing
a: break a;

which doesn't work properly on some versions of Edge.
Make sure this doesn ' t compile to code containing a : break a ; which doesn ' t work properly on some versions of Edge .
@Test
  public void testNoSelfReferencingBreakWithSyntheticBlocks() {
    CompilerOptions options = createCompilerOptions();
    CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
    options.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.OFF);
    options.syntheticBlockStartMarker = "START";
    options.syntheticBlockEndMarker = "END";
    test(
        options,
        lines(
            "const D = false;",
            "/**",
            " * @param {string} m",
            " */",
            "function b(m) {",
            " if (!D) return;",
            "",
            " START('debug');",
            " alert('Shouldnt be here' + m);",
            " END('debug');",
            "}",
            "/**",
            " * @param {string} arg",
            " */",
            "function a(arg) {",
            "  if (arg == 'log') {",
            "    b('logging 1');",
            "    b('logging 2');",
            "  } else {",
            "    alert('Hi!');",
            "  }",
            "}",
            "",
            "a(input);"),
        "'log' != input && alert('Hi!')");
  }
@ Test public void testNoSelfReferencingBreakWithSyntheticBlocks ( ) { CompilerOptions options = createCompilerOptions ( ) ; CompilationLevel . ADVANCED_OPTIMIZATIONS . setOptionsForCompilationLevel ( options ) ; options . setWarningLevel ( DiagnosticGroups . UNDEFINED_VARIABLES , CheckLevel . OFF ) ; options . syntheticBlockStartMarker = "START" ; options . syntheticBlockEndMarker = "END" ; test ( options , lines ( "const D = false;" , "/**" , " * @param {string} m" , " */" , "function b(m) {" , " if (!D) return;" , "" , " START('debug');" , " alert('Shouldnt be here' + m);" , " END('debug');" , "}" , "/**" , " * @param {string} arg" , " */" , "function a(arg) {" , "  if (arg == 'log') {" , "    b('logging 1');" , "    b('logging 2');" , "  } else {" , "    alert('Hi!');" , "  }" , "}" , "" , "a(input);" ) , "'log' != input && alert('Hi!')" ) ; }
Make sure this doesn't compile to code containing
 <pre>a: break a;</pre>
Make sure this doesn ' t compile to code containing <pre > a : break a ; < / pre >