This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197578 - "Code has no side effect" error with a for loop without a block
Summary: "Code has no side effect" error with a for loop without a block
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 16:03 UTC by plynch
Modified: 2015-05-15 09:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description plynch 2011-04-08 16:03:09 UTC
I sometimes write for-loops that do not have a block, but are just used for moving an index forward or searching through a chain.  For example:

    var container = field.parentNode;
    for (;container && container.className!='container';
         container = container.parentNode);
    // now do something with "container"

Netbeans incorrectly flags the semi-colon on the for-loop and reports that the code has no side effects, event though it does have the intended of setting the variable "container".
Comment 1 Petr Pisl 2015-05-15 09:00:12 UTC
This is already fixed.