src/jdk/nashorn/internal/codegen/Lower.java

Print this page

        

*** 523,533 **** final Expression test = whileNode.getTest(); final Block body = whileNode.getBody(); if (isAlwaysTrue(test)) { //turn it into a for node without a test. ! final ForNode forNode = (ForNode)new ForNode(whileNode.getLineNumber(), whileNode.getToken(), whileNode.getFinish(), body, ForNode.IS_FOR).accept(this); lc.replace(whileNode, forNode); return forNode; } return addStatement(checkEscape(whileNode)); --- 523,533 ---- final Expression test = whileNode.getTest(); final Block body = whileNode.getBody(); if (isAlwaysTrue(test)) { //turn it into a for node without a test. ! final ForNode forNode = (ForNode)new ForNode(whileNode.getLineNumber(), whileNode.getToken(), whileNode.getFinish(), body, 0).accept(this); lc.replace(whileNode, forNode); return forNode; } return addStatement(checkEscape(whileNode));