< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java

Print this page

        

*** 460,469 **** --- 460,481 ---- } } return next; } + /** + * Determine whether this block needs to provide its scope object creator for use by its child nodes. + * This is only necessary for synthetic parent blocks of for-in loops with lexical declarations. + * + * @return true if child nodes need access to this block's scope creator + */ + public boolean providesScopeCreator() { + return needsScope() && isSynthetic() + && (getLastStatement() instanceof ForNode) + && ((ForNode) getLastStatement()).needsScopeCreator(); + } + @Override public boolean isBreakableWithoutLabel() { return false; }
< prev index next >