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

Summary: "Code has no side effect" error with a for loop without a block
Product: javascript Reporter: plynch
Component: EditorAssignee: Petr Pisl <ppisl>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

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.