src/jdk/nashorn/internal/parser/Parser.java

Print this page

        

@@ -705,24 +705,13 @@
             new IdentNode(functionToken, Token.descPosition(functionToken), scriptName),
             new ArrayList<IdentNode>(),
             FunctionNode.Kind.SCRIPT,
             functionLine);
 
-        // If ES6 block scope is enabled add a per-script block for top-level LET and CONST declarations.
-        final int startLine = start;
-        Block outer = useBlockScope() ? newBlock() : null;
         functionDeclarations = new ArrayList<>();
-
-        try {
             sourceElements(allowPropertyFunction);
             addFunctionDeclarations(script);
-        } finally {
-            if (outer != null) {
-                outer = restoreBlock(outer);
-                appendStatement(new BlockStatement(startLine, outer));
-            }
-        }
         functionDeclarations = null;
 
         expect(EOF);
 
         script.setFinish(source.getLength() - 1);