Menu

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.

     
    • Matthias Miller

      Matthias Miller - 2006-08-26

      The inability to properly suppress this warning is a bug, which I've fixed on the trunk. This fix will be included in the next release.

      I've created a tracker item for your suggestion: https://sourceforge.net/tracker/index.php?func=detail&aid=1547250&group_id=168518&atid=847185.

      Thanks a lot for your feedback. Hope this helps.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.