--- old/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java 2016-03-22 11:11:27.407412541 +0100 +++ new/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java 2016-03-22 11:11:27.259412546 +0100 @@ -462,6 +462,18 @@ 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;