Sha256: 82bb452e888ebc1ad1c78098c600b0837a826a232d86df51bda692496e5f72df

Contents?: true

Size: 906 Bytes

Versions: 43

Compression:

Stored size: 906 Bytes

Contents

/*jsl:option explicit*/
function comparison_type_conv() {
    var a, b, c;

    /* comparison against null */
    if (a == null || b < c) { /*warning:comparison_type_conv*/
        a = b;
    }
    if (a === null || b < c) {
        a = b;
    }

    /* comparison against zero */
    if (c > a && a + b == 0) { /*warning:comparison_type_conv*/
        c = -c;
    }
    if (c > a && a + b === 0) {
        c = -c;
    }

    /* comparison against blank string */
    if (a == "") { /*warning:comparison_type_conv*/
        b = c;
    }
    if (a === "") {
        b = c;
    }

    /* comparison against true */
    if (a == true) { /*warning:comparison_type_conv*/
        c = b;
    }
    if (a === true) {
        c = b;
    }

    /* comparison against false */
    if (a == false) { /*warning:comparison_type_conv*/
        c = a;
    }
    if (a === false) {
        c = a;
    }
}

Version data entries

43 entries across 43 versions & 1 rubygems

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