< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitIntoFunctions.java

Print this page

        

@@ -310,14 +310,10 @@
             return super.enterVarNode(varNode);
         }
         assert !varNode.isBlockScoped(); //TODO: we must handle these too, but we currently don't
 
         final Expression init = varNode.getInit();
-        if (varNode.isAnonymousFunctionDeclaration()) {
-            // We ain't moving anonymous function declarations.
-            return super.enterVarNode(varNode);
-        }
 
         // Move a declaration-only var statement to the top of the outermost function.
         getCurrentFunctionState().varStatements.add(varNode.setInit(null));
         // If it had an initializer, replace it with an assignment expression statement. Note that "var" is a
         // statement, so it doesn't contribute to :return of the programs, therefore we are _not_ adding a
< prev index next >