Sha256: 1d94f402d90ad3135c96acd166a2207bb690142091cd023015f4917de7efb1f2

Contents?: true

Size: 1.41 KB

Versions: 43

Compression:

Stored size: 1.41 KB

Contents

/*jsl:option explicit*/
function missing_break() {
    var i, o, s;

    switch (i) {
      /* okay because of return */
      default:
        return "";
    }

    switch (i) {
      /* okay because of throw */
      default:
        throw s;
    }

    switch (i) {
      case 1:
        s += ".";
        /*missing break*/

      case 2: /*warning:missing_break*/
        /*okay because of return*/
        s += ",";
        return s;

      case 3:
        /*okay because of throw*/
        s += ";";
        throw s;

      case 4:
        /*okay because of break/throw*/
        if (s) {
            break;
        }
        else {
            throw i;
        }

      case 5:
        /*missing break in catch*/
        try {
            i--;
            break;
        }
        catch (err) {
            s = null;
        }
        finally {
            i++;
        }

      case 6: /*warning:missing_break*/
        /*ok; finally statement never called*/
        try {
            i--;
            break;
        }
        catch (err) {
            s = null;
            break;
        }
        finally {
            i++;
        }

      case 7:
        /*ok; break statement in catch and finally*/
        try {
            i--;
        }
        catch (err) {
            s = null;
            break;
        }
        finally {
            i++;
            break;
        }

      default:
        break;
    }

    return "";
}

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
distil-0.14.5.a vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.4 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.3 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.2 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.2.a vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.1 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.1.a vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.i vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.h vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.g vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.d vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.c vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.14.0.b vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.6 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.5 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.4 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.3 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.2 vendor/jsl-0.3.0/tests/warnings/missing_break.js
distil-0.13.1 vendor/jsl-0.3.0/tests/warnings/missing_break.js