increment/decrement operators

2006-08-25
2013-05-28
  • Devon Miller
    Devon Miller
    2006-08-25

    I have a loop doing decoding of data from a cookie that in part reads like this:

        do {
            /*jsl:ignore*/
            chr1 = input.charCodeAt(i++);
            chr2 = input.charCodeAt(i++);
            chr3 = input.charCodeAt(i++);
            /*jsl:end*/
            // lots more code
        } while (i < len);

    I'm still getting warnings:

    source.js(104): lint warning: increment (++) and decrement (--) operators used as part of greater statement
            } while (i < len);
    .........................^

    I don't want to disable all checking for the loop, but I would like a way to quiet this warning. Is there a control comment that can turn off/on a single warning? Maybe a syntax like:
    /*jsl:on:inc_dec_within_stmt*/
    /*jsl:off:inc_dec_within_stmt*/
    It would be nice if it  could take a comma separated list of warnings. Maybe /*jsl:resetWarnings*/ to fall back to the warnings as set in the config file.