#4 Request for /*jsl:emptyblock*/ (or similar)

closed
nobody
None
5
2006-07-15
2006-07-10
Cam Woods
No

This is a feature request for a /*jsl:emptyblock
<optional-comment> */ (or similar) option similar
to /*jsl:fallthru*/ to allow code as below where I
want Lint to not complain about an empty block of
code. While the "empty statement or extra semicolon"
warning is generally helpful, there are times when
code like that below is more readable than other
forms.

if (<something1>)
{
/*jsl:emptyblock -- In this case, do nothing! */
}
else if (<something2>)
{
<Do something>
}
else if (<something3>)
{
<Do something>
}
else if (<something4>)
{
<Do something>
}
else if (<something5>)
{
<Do something>
}

Discussion

  • Martin Harper
    Martin Harper
    2006-07-14

    Logged In: YES
    user_id=861973

    As a workaround, you can use this:

    if (<something1>)
    {
    null; // do nothing
    }

     
  • Logged In: YES
    user_id=1357599

    Hopefully this need only be a temporary workaround.

     
    • status: open --> closed
     
  • Logged In: YES
    user_id=1357599

    Added /*jsl:pass*/ on trunk.