From 0ed9eb856c9566abe8e493c1aaa693b81ee00fa2 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Mon, 9 Mar 2015 20:14:10 +0530 Subject: [PATCH] 8074671: Nashorn Parser API Reviewed-by: darcy, forax, attila, hannesw --- nashorn/make/build.xml | 22 +- nashorn/make/nbproject/project.xml | 10 +- nashorn/make/project.properties | 30 +- nashorn/samples/evalcheck.js | 58 + nashorn/samples/withcheck.js | 38 + .../jdk/nashorn/api/tree/ArrayAccessTree.java | 53 + .../nashorn/api/tree/ArrayAccessTreeImpl.java | 59 + .../nashorn/api/tree/ArrayLiteralTree.java | 43 + .../api/tree/ArrayLiteralTreeImpl.java | 53 + .../jdk/nashorn/api/tree/AssignmentTree.java | 53 + .../nashorn/api/tree/AssignmentTreeImpl.java | 61 + .../jdk/nashorn/api/tree/BinaryTree.java | 54 + .../jdk/nashorn/api/tree/BinaryTreeImpl.java | 61 + .../jdk/nashorn/api/tree/BlockTree.java | 50 + .../jdk/nashorn/api/tree/BlockTreeImpl.java | 59 + .../jdk/nashorn/api/tree/BreakTree.java | 49 + .../jdk/nashorn/api/tree/BreakTreeImpl.java | 53 + .../jdk/nashorn/api/tree/CaseTree.java | 59 + .../jdk/nashorn/api/tree/CaseTreeImpl.java | 62 + .../jdk/nashorn/api/tree/CatchTree.java | 62 + .../jdk/nashorn/api/tree/CatchTreeImpl.java | 69 + .../nashorn/api/tree/CompilationUnitTree.java | 66 + .../api/tree/CompilationUnitTreeImpl.java | 73 + .../api/tree/CompoundAssignmentTree.java | 54 + .../api/tree/CompoundAssignmentTreeImpl.java | 63 + .../api/tree/ConditionalExpressionTree.java | 60 + .../tree/ConditionalExpressionTreeImpl.java | 67 + .../nashorn/api/tree/ConditionalLoopTree.java | 41 + .../jdk/nashorn/api/tree/ContinueTree.java | 48 + .../nashorn/api/tree/ContinueTreeImpl.java | 53 + .../jdk/nashorn/api/tree/DebuggerTree.java | 40 + .../nashorn/api/tree/DebuggerTreeImpl.java | 44 + .../jdk/nashorn/api/tree/Diagnostic.java | 151 + .../jdk/nashorn/api/tree/DiagnosticImpl.java | 81 + .../nashorn/api/tree/DiagnosticListener.java | 42 + .../jdk/nashorn/api/tree/DoWhileLoopTree.java | 55 + .../nashorn/api/tree/DoWhileLoopTreeImpl.java | 60 + .../nashorn/api/tree/EmptyStatementTree.java | 39 + .../api/tree/EmptyStatementTreeImpl.java | 44 + .../jdk/nashorn/api/tree/ErroneousTree.java | 35 + .../nashorn/api/tree/ErroneousTreeImpl.java | 44 + .../api/tree/ExpressionStatementTree.java | 46 + .../api/tree/ExpressionStatementTreeImpl.java | 52 + .../jdk/nashorn/api/tree/ExpressionTree.java | 35 + .../nashorn/api/tree/ExpressionTreeImpl.java | 34 + .../jdk/nashorn/api/tree/ForInLoopTree.java | 68 + .../nashorn/api/tree/ForInLoopTreeImpl.java | 77 + .../jdk/nashorn/api/tree/ForLoopTree.java | 68 + .../jdk/nashorn/api/tree/ForLoopTreeImpl.java | 79 + .../nashorn/api/tree/FunctionCallTree.java | 57 + .../api/tree/FunctionCallTreeImpl.java | 61 + .../api/tree/FunctionDeclarationTree.java | 71 + .../api/tree/FunctionDeclarationTreeImpl.java | 80 + .../api/tree/FunctionExpressionTree.java | 71 + .../api/tree/FunctionExpressionTreeImpl.java | 85 + .../jdk/nashorn/api/tree/GotoTree.java | 45 + .../jdk/nashorn/api/tree/IRTranslator.java | 517 ++ .../jdk/nashorn/api/tree/IdentifierTree.java | 46 + .../nashorn/api/tree/IdentifierTreeImpl.java | 53 + .../classes/jdk/nashorn/api/tree/IfTree.java | 67 + .../jdk/nashorn/api/tree/IfTreeImpl.java | 69 + .../jdk/nashorn/api/tree/InstanceOfTree.java | 53 + .../nashorn/api/tree/InstanceOfTreeImpl.java | 58 + .../api/tree/LabeledStatementTree.java | 53 + .../api/tree/LabeledStatementTreeImpl.java | 60 + .../classes/jdk/nashorn/api/tree/LineMap.java | 54 + .../jdk/nashorn/api/tree/LineMapImpl.java | 46 + .../jdk/nashorn/api/tree/LiteralTree.java | 47 + .../jdk/nashorn/api/tree/LiteralTreeImpl.java | 67 + .../jdk/nashorn/api/tree/LoopTree.java | 41 + .../nashorn/api/tree/MemberSelectTree.java | 53 + .../api/tree/MemberSelectTreeImpl.java | 59 + .../classes/jdk/nashorn/api/tree/NewTree.java | 50 + .../jdk/nashorn/api/tree/NewTreeImpl.java | 53 + .../nashorn/api/tree/ObjectLiteralTree.java | 43 + .../api/tree/ObjectLiteralTreeImpl.java | 53 + .../nashorn/api/tree/ParenthesizedTree.java | 47 + .../classes/jdk/nashorn/api/tree/Parser.java | 160 + .../jdk/nashorn/api/tree/ParserImpl.java | 145 + .../jdk/nashorn/api/tree/PropertyTree.java | 64 + .../nashorn/api/tree/PropertyTreeImpl.java | 76 + .../nashorn/api/tree/RegExpLiteralTree.java | 48 + .../api/tree/RegExpLiteralTreeImpl.java | 62 + .../jdk/nashorn/api/tree/ReturnTree.java | 48 + .../jdk/nashorn/api/tree/ReturnTreeImpl.java | 52 + .../api/tree/SimpleTreeVisitorES5_1.java | 390 + .../jdk/nashorn/api/tree/StatementTree.java | 36 + .../nashorn/api/tree/StatementTreeImpl.java | 39 + .../jdk/nashorn/api/tree/SwitchTree.java | 58 + .../jdk/nashorn/api/tree/SwitchTreeImpl.java | 61 + .../jdk/nashorn/api/tree/ThrowTree.java | 46 + .../jdk/nashorn/api/tree/ThrowTreeImpl.java | 51 + .../classes/jdk/nashorn/api/tree/Tree.java | 599 ++ .../jdk/nashorn/api/tree/TreeImpl.java | 154 + .../jdk/nashorn/api/tree/TreeVisitor.java | 438 + .../classes/jdk/nashorn/api/tree/TryTree.java | 67 + .../jdk/nashorn/api/tree/TryTreeImpl.java | 69 + .../jdk/nashorn/api/tree/UnaryTree.java | 49 + .../jdk/nashorn/api/tree/UnaryTreeImpl.java | 53 + .../api/tree/UnknownTreeException.java | 83 + .../jdk/nashorn/api/tree/VariableTree.java | 54 + .../nashorn/api/tree/VariableTreeImpl.java | 59 + .../jdk/nashorn/api/tree/WhileLoopTree.java | 54 + .../nashorn/api/tree/WhileLoopTreeImpl.java | 60 + .../jdk/nashorn/api/tree/WithTree.java | 54 + .../jdk/nashorn/api/tree/WithTreeImpl.java | 59 + .../jdk/nashorn/api/tree/package-info.java | 75 + .../jdk/nashorn/internal/codegen/Lower.java | 10 + .../jdk/nashorn/internal/ir/Block.java | 20 +- .../nashorn/internal/ir/BlockStatement.java | 9 + .../jdk/nashorn/internal/ir/DebuggerNode.java | 63 + .../jdk/nashorn/internal/ir/ErrorNode.java | 69 + .../jdk/nashorn/internal/ir/LiteralNode.java | 29 + .../nashorn/internal/ir/debug/JSONWriter.java | 30 +- .../internal/ir/visitor/NodeVisitor.java | 43 + .../jdk/nashorn/internal/parser/Parser.java | 24 +- .../jdk/nashorn/internal/runtime/Source.java | 26 +- .../internal/runtime/options/Options.java | 1 + .../basic/parser/tryCatchStat.js.EXPECTED | 486 +- nashorn/test/script/basic/parser/util.js | 2 +- nashorn/test/script/nosecurity/parserapi.js | 126 + .../script/nosecurity/parserapi.js.EXPECTED | 7015 +++++++++++++++++ .../nosecurity/parserapi_const_as_var.js | 39 + .../parserapi_const_as_var.js.EXPECTED | 3 + .../script/nosecurity/parserapi_empty_stat.js | 45 + .../parserapi_empty_stat.js.EXPECTED | 1 + .../test/script/nosecurity/parserapi_nse.js | 102 + .../nosecurity/parserapi_nse.js.EXPECTED | 43 + .../script/nosecurity/parserapi_scripting.js | 47 + .../parserapi_scripting.js.EXPECTED | 9 + .../script/nosecurity/parserapi_strict.js | 59 + .../nosecurity/parserapi_strict.js.EXPECTED | 16 + .../parsernegativetests/caseoutofswitch.js | 32 + .../parsernegativetests/illegalbreak.js | 30 + .../parsernegativetests/illegalcontinue.js | 30 + .../parsernegativetests/illegallvalue.js | 31 + .../parsernegativetests/illegaloperator.js | 29 + .../parsernegativetests/keywordident.js | 30 + .../parsernegativetests/parenmissing.js | 30 + .../parsernegativetests/repeatedproperty.js | 33 + .../strict_repeatedproperty.js | 32 + .../parsernegativetests/strict_repeatparam.js | 31 + .../parsernegativetests/strict_with.js | 31 + .../parsernegativetests/toplevelreturn.js | 30 + .../nosecurity/parsertests/array_literal.js | 33 + .../nosecurity/parsertests/assignmentExpr.js | 42 + .../nosecurity/parsertests/binaryExpr.js | 51 + .../script/nosecurity/parsertests/block.js | 31 + .../nosecurity/parsertests/breakStat.js | 32 + .../script/nosecurity/parsertests/condExpr.js | 31 + .../nosecurity/parsertests/continueStat.js | 32 + .../nosecurity/parsertests/debuggerStat.js | 30 + .../nosecurity/parsertests/functions.js | 36 + .../script/nosecurity/parsertests/ifStat.js | 31 + .../nosecurity/parsertests/labelledStat.js | 31 + .../script/nosecurity/parsertests/lhsExpr.js | 44 + .../script/nosecurity/parsertests/loopStat.js | 34 + .../nosecurity/parsertests/objectLitExpr.js | 34 + .../nosecurity/parsertests/parenExpr.js | 31 + .../nosecurity/parsertests/primaryExpr.js | 42 + .../nosecurity/parsertests/regexp_literal.js | 32 + .../nosecurity/parsertests/returnStat.js | 32 + .../nosecurity/parsertests/switchStat.js | 32 + .../nosecurity/parsertests/throwStat.js | 34 + .../nosecurity/parsertests/tryCatchStat.js | 35 + .../nosecurity/parsertests/unaryExpr.js | 40 + .../nosecurity/parsertests/useStrict.js | 31 + .../script/nosecurity/parsertests/varDecl.js | 37 + .../script/nosecurity/parsertests/withStat.js | 30 + .../test/script/nosecurity/parservisitor.js | 380 + .../nosecurity/parservisitor.js.EXPECTED | 87 + .../jdk/nashorn/api/tree/ParseAPITest.java | 188 + .../internal/codegen/CompilerTest.java | 1 - .../nashorn/internal/parser/ParserTest.java | 1 - 174 files changed, 17893 insertions(+), 317 deletions(-) create mode 100644 nashorn/samples/evalcheck.js create mode 100644 nashorn/samples/withcheck.js create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMapImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParserImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTreeImpl.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/DebuggerNode.java create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ErrorNode.java create mode 100644 nashorn/test/script/nosecurity/parserapi.js create mode 100644 nashorn/test/script/nosecurity/parserapi.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_const_as_var.js create mode 100644 nashorn/test/script/nosecurity/parserapi_const_as_var.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_empty_stat.js create mode 100644 nashorn/test/script/nosecurity/parserapi_empty_stat.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_nse.js create mode 100644 nashorn/test/script/nosecurity/parserapi_nse.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_scripting.js create mode 100644 nashorn/test/script/nosecurity/parserapi_scripting.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parserapi_strict.js create mode 100644 nashorn/test/script/nosecurity/parserapi_strict.js.EXPECTED create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/caseoutofswitch.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegalbreak.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegalcontinue.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegallvalue.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/illegaloperator.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/keywordident.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/parenmissing.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/repeatedproperty.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_repeatedproperty.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_repeatparam.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/strict_with.js create mode 100644 nashorn/test/script/nosecurity/parsernegativetests/toplevelreturn.js create mode 100644 nashorn/test/script/nosecurity/parsertests/array_literal.js create mode 100644 nashorn/test/script/nosecurity/parsertests/assignmentExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/binaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/block.js create mode 100644 nashorn/test/script/nosecurity/parsertests/breakStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/condExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/continueStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/debuggerStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/functions.js create mode 100644 nashorn/test/script/nosecurity/parsertests/ifStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/labelledStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/lhsExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/loopStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/objectLitExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/parenExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/primaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/regexp_literal.js create mode 100644 nashorn/test/script/nosecurity/parsertests/returnStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/switchStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/throwStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/tryCatchStat.js create mode 100644 nashorn/test/script/nosecurity/parsertests/unaryExpr.js create mode 100644 nashorn/test/script/nosecurity/parsertests/useStrict.js create mode 100644 nashorn/test/script/nosecurity/parsertests/varDecl.js create mode 100644 nashorn/test/script/nosecurity/parsertests/withStat.js create mode 100644 nashorn/test/script/nosecurity/parservisitor.js create mode 100644 nashorn/test/script/nosecurity/parservisitor.js.EXPECTED create mode 100644 nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml index 9bc4d670618..bd85a06aba9 100644 --- a/nashorn/make/build.xml +++ b/nashorn/make/build.xml @@ -98,7 +98,7 @@ - + @@ -209,7 +209,7 @@ - @@ -227,7 +227,7 @@ - @@ -314,6 +314,15 @@ grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" { permission java.security.AllPermission; }; +grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" { + permission java.util.PropertyPermission "parserapitest.*", "read"; + permission java.util.PropertyPermission "test.*", "read"; + permission java.util.PropertyPermission "test262.*", "read"; + permission java.io.FilePermission "${basedir}/test/-","read"; + permission java.io.FilePermission "$${user.dir}", "read"; + permission java.util.PropertyPermission "user.dir", "read"; +}; + grant codeBase "file:/${basedir}/${file.reference.testng.jar}" { permission java.security.AllPermission; }; @@ -395,6 +404,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { + @@ -440,7 +450,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { + verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> @@ -466,7 +476,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + @@ -478,7 +488,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + diff --git a/nashorn/make/nbproject/project.xml b/nashorn/make/nbproject/project.xml index 94d0c147019..b39e8734cb6 100644 --- a/nashorn/make/nbproject/project.xml +++ b/nashorn/make/nbproject/project.xml @@ -2,21 +2,21 @@