--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java Thu Jan 21 10:17:48 2016 -0800
@@ -83,6 +83,6 @@
/**
* Contains the linker for ordinary Java objects.
- * @since 1.9
+ * @since 9
*/
package jdk.dynalink.beans;
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java Thu Jan 21 10:17:48 2016 -0800
@@ -111,6 +111,6 @@
* implement the {@link jdk.dynalink.linker.GuardingTypeConverterFactory}
* interface to provide the logic for these conversions.
* </p>
- * @since 1.9
+ * @since 9
*/
package jdk.dynalink.linker;
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java Thu Jan 21 10:17:48 2016 -0800
@@ -87,6 +87,6 @@
* by providing basic implementations of some classes as well as various
* utilities.
* </p>
- * @since 1.9
+ * @since 9
*/
package jdk.dynalink.linker.support;
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java Thu Jan 21 10:17:48 2016 -0800
@@ -85,6 +85,6 @@
* <p>Contains classes that make using Dynalink more convenient by providing
* basic implementations of some classes as well as various utilities.
* </p>
- * @since 1.9
+ * @since 9
*/
package jdk.dynalink.support;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>expression</em> [ <em>index</em> ]
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ArrayAccessTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -30,7 +30,7 @@
/**
* Represents ECMAScript array literal expression.
*
- * @since 1.9
+ * @since 9
*/
public interface ArrayLiteralTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>variable</em> = <em>expression</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface AssignmentTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>leftOperand</em> <em>operator</em> <em>rightOperand</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface BinaryTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -37,7 +37,7 @@
* { <em>statements</em> }
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface BlockTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -35,7 +35,7 @@
* break <em>label</em> ;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface BreakTree extends GotoTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -39,7 +39,7 @@
* <em>statements</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface CaseTree extends Tree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>block</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface CatchTree extends Tree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -31,7 +31,7 @@
* Represents the abstract syntax tree for compilation units (source
* files)
*
- * @since 1.9
+ * @since 9
*/
public interface CompilationUnitTree extends Tree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>variable</em> <em>operator</em> <em>expression</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface CompoundAssignmentTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>condition</em> ? <em>trueExpression</em> : <em>falseExpression</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ConditionalExpressionTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* A mixin for conditional "loop" statements.
*
- * @since 1.9
+ * @since 9
*/
public interface ConditionalLoopTree extends LoopTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* continue <em>label</em> ;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ContinueTree extends GotoTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>debugger;</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface DebuggerTree extends StatementTree {
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java Thu Jan 21 10:17:48 2016 -0800
@@ -40,7 +40,7 @@
* <p>Line terminator is as defined in ECMAScript specification which is one
* of { \u000A, \u000B, \u2028, \u2029 }.
*
- * @since 1.9
+ * @since 9
*/
public interface Diagnostic {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* Interface for receiving diagnostics from Nashorn parser.
*
- * @since 1.9
+ * @since 9
*/
@FunctionalInterface
public interface DiagnosticListener {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -35,7 +35,7 @@
* while ( <em>expression</em> );
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface DoWhileLoopTree extends ConditionalLoopTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,6 +33,6 @@
* ;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface EmptyStatementTree extends StatementTree {}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* A tree node to stand in for a malformed expression.
*
- * @since 1.9
+ * @since 9
*/
public interface ErroneousTree extends ExpressionTree {
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>expression</em> ;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ExpressionStatementTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -29,6 +29,6 @@
* A tree node used as the base class for the different types of
* expressions.
*
- * @since 1.9
+ * @since 9
*/
public interface ExpressionTree extends Tree {}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>statement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ForInLoopTree extends LoopTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>statement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ForLoopTree extends ConditionalLoopTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -37,7 +37,7 @@
* this . <em>identifier</em> ( <em>arguments</em> )
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionCallTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -37,7 +37,7 @@
* <em>body</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionDeclarationTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -37,7 +37,7 @@
* <em>body</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface FunctionExpressionTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -31,7 +31,7 @@
* type serves as a super interface for {@link BreakTree} and
* {@link ContinueTree}.
*
- * @since 1.9
+ * @since 9
*/
public interface GotoTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>name</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface IdentifierTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -39,7 +39,7 @@
* <em>elseStatement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface IfTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>expression</em> instanceof <em>type</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface InstanceOfTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>label</em> : <em>statement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface LabeledStatementTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java Thu Jan 21 10:17:48 2016 -0800
@@ -29,7 +29,7 @@
* Provides methods to convert between character positions and line numbers
* for a compilation unit.
*
- * @since 1.9
+ * @since 9
*/
public interface LineMap {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>value</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface LiteralTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* A mixin for "loop" statements.
*
- * @since 1.9
+ * @since 9
*/
public interface LoopTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>expression</em> . <em>identifier</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface MemberSelectTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -35,7 +35,7 @@
* new <em>identifier</em> ( <em>arguments</em> )
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface NewTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -30,7 +30,7 @@
/**
* Represents ECMAScript object literal expression.
*
- * @since 1.9
+ * @since 9
*/
public interface ObjectLiteralTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* ( <em>expression</em> )
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ParenthesizedTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java Thu Jan 21 10:17:48 2016 -0800
@@ -36,7 +36,7 @@
/**
* Represents nashorn ECMAScript parser instance.
*
- * @since 1.9
+ * @since 9
*/
public interface Parser {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* To represent property setting in an object literal tree.
*
- * @since 1.9
+ * @since 9
*/
public interface PropertyTree extends Tree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -28,7 +28,7 @@
/**
* Represents regular expression literal in the source code.
*
- * @since 1.9
+ * @since 9
*/
public interface RegExpLiteralTree extends Tree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* return <em>expression</em>;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ReturnTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -29,7 +29,7 @@
* A tree node used as the base class for the different kinds of
* statements.
*
- * @since 1.9
+ * @since 9
*/
public interface StatementTree extends Tree {
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -37,7 +37,7 @@
* }
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface SwitchTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* throw <em>expression</em>;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface ThrowTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java Thu Jan 21 10:17:48 2016 -0800
@@ -31,7 +31,7 @@
* <p><b>WARNING:</b> This interface and its sub-interfaces are
* subject to change as the ECMAScript programming language evolves.
*
- * @since 1.9
+ * @since 9
*/
public interface Tree {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java Thu Jan 21 10:17:48 2016 -0800
@@ -51,7 +51,7 @@
* methods. Use {@code Void} for visitors that do not need an
* additional parameter.
*
- * @since 1.9
+ * @since 9
*/
public interface TreeVisitor<R,P> {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -39,7 +39,7 @@
* <em>finallyBlock</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface TryTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -36,7 +36,7 @@
* <em>expression</em> <em>operator</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface UnaryTree extends ExpressionTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* {@linkplain TreeVisitor tree visitor} to indicate that the
* visitor was created for a prior version of the language.
*
- * @since 1.9
+ * @since 9
*/
public class UnknownTreeException extends RuntimeException {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -33,7 +33,7 @@
* <em>var</em> <em>name</em> <em>initializer</em> ;
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface VariableTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>statement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface WhileLoopTree extends ConditionalLoopTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java Thu Jan 21 10:17:48 2016 -0800
@@ -34,7 +34,7 @@
* <em>statement</em>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
public interface WithTree extends StatementTree {
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java Thu Jan 21 10:17:48 2016 -0800
@@ -68,7 +68,7 @@
* </code>
* </pre>
*
- * @since 1.9
+ * @since 9
*/
package jdk.nashorn.api.tree;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java Thu Jan 21 10:17:48 2016 -0800
@@ -335,7 +335,7 @@
break;
case SHR:
final long result = JSType.toUint32(lhs.getInt32() >>> rhs.getInt32());
- return LiteralNode.newInstance(token, finish, JSType.isRepresentableAsInt(result) ? (int) result : (double) result);
+ return LiteralNode.newInstance(token, finish, JSType.toNarrowestNumber(result));
case SAR:
return LiteralNode.newInstance(token, finish, lhs.getInt32() >> rhs.getInt32());
case SHL:
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java Thu Jan 21 10:17:48 2016 -0800
@@ -70,7 +70,6 @@
import jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator;
import jdk.nashorn.internal.runtime.arrays.ContinuousArrayData;
import jdk.nashorn.internal.runtime.arrays.IntElements;
-import jdk.nashorn.internal.runtime.arrays.IntOrLongElements;
import jdk.nashorn.internal.runtime.arrays.IteratorAction;
import jdk.nashorn.internal.runtime.arrays.NumericElements;
import jdk.nashorn.internal.runtime.linker.Bootstrap;
@@ -285,7 +284,7 @@
final long newLen = NativeArray.validLength(newLenDesc.getValue());
// Step 3e - note that we need to convert to int or double as long is not considered a JS number type anymore
- newLenDesc.setValue(JSType.isRepresentableAsInt(newLen) ? Integer.valueOf((int) newLen) : Double.valueOf((double) newLen));
+ newLenDesc.setValue(JSType.toNarrowestNumber(newLen));
// Step 3f
// increasing array length - just need to set new length value (and attributes if any) and return
@@ -1043,7 +1042,7 @@
if (bulkable(sobj) && sobj.getArray().length() + args.length <= JSType.MAX_UINT) {
final ArrayData newData = sobj.getArray().push(true, args);
sobj.setArray(newData);
- return newData.length();
+ return JSType.toNarrowestNumber(newData.length());
}
long len = JSType.toUint32(sobj.getLength());
@@ -1052,7 +1051,7 @@
}
sobj.set("length", len, CALLSITE_STRICT);
- return len;
+ return JSType.toNarrowestNumber(len);
} catch (final ClassCastException | NullPointerException e) {
throw typeError(Context.getGlobal(), e, "not.an.object", ScriptRuntime.safeToString(self));
}
@@ -1471,7 +1470,7 @@
final long newLength = len + items.length;
sobj.set("length", newLength, CALLSITE_STRICT);
- return newLength;
+ return JSType.toNarrowestNumber(newLength);
}
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java Thu Jan 21 10:17:48 2016 -0800
@@ -791,6 +791,15 @@
return Double.NaN;
}
+ /**
+ * Convert a long to the narrowest JavaScript Number type. This returns either a
+ * {@link Integer} or {@link Double} depending on the magnitude of {@code l}.
+ * @param l a long value
+ * @return the value converted to Integer or Double
+ */
+ public static Number toNarrowestNumber(final long l) {
+ return isRepresentableAsInt(l) ? Integer.valueOf((int) l) : Double.valueOf((double) l);
+ }
/**
* JavaScript compliant conversion of Boolean to number
@@ -1727,21 +1736,6 @@
}
/**
- * Returns the boxed version of a primitive class
- * @param clazz the class
- * @return the boxed type of clazz, or unchanged if not primitive
- */
- public static Class<?> getBoxedClass(final Class<?> clazz) {
- if (clazz == int.class) {
- return Integer.class;
- } else if (clazz == double.class) {
- return Double.class;
- }
- assert !clazz.isPrimitive();
- return clazz;
- }
-
- /**
* Create a method handle constant of the correct primitive type
* for a constant object
* @param o object
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyListeners.java Thu Jan 21 10:17:48 2016 -0800
@@ -54,7 +54,13 @@
*/
PropertyListeners(final PropertyListeners listener) {
if (listener != null && listener.listeners != null) {
- this.listeners = new WeakHashMap<>(listener.listeners);
+ this.listeners = new WeakHashMap<>();
+ // We need to copy the nested weak sets in order to avoid concurrent modification issues, see JDK-8146274
+ synchronized (listener) {
+ for (final Map.Entry<Object, WeakPropertyMapSet> entry : listener.listeners.entrySet()) {
+ this.listeners.put(entry.getKey(), new WeakPropertyMapSet(entry.getValue()));
+ }
+ }
}
}
@@ -228,7 +234,15 @@
private static class WeakPropertyMapSet {
- private final WeakHashMap<PropertyMap, Boolean> map = new WeakHashMap<>();
+ private final WeakHashMap<PropertyMap, Boolean> map;
+
+ WeakPropertyMapSet() {
+ this.map = new WeakHashMap<>();
+ }
+
+ WeakPropertyMapSet(final WeakPropertyMapSet set) {
+ this.map = new WeakHashMap<>(set.map);
+ }
void add(final PropertyMap propertyMap) {
map.put(propertyMap, Boolean.TRUE);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties Thu Jan 21 10:17:48 2016 -0800
@@ -24,7 +24,7 @@
Object.isSealed=tells if an object is sealed or not
-Object.isFrozen=tells if an object is fronzen or not
+Object.isFrozen=tells if an object is frozen or not
Object.isExtensible=tells if an object is extensible or not
@@ -32,7 +32,7 @@
Object=creates a new script object or converts given value as a script object
-Object.prototype.toString=returns a string representing of this object
+Object.prototype.toString=returns a string representation of this object
Object.prototype.hasOwnProperty=tells whether this object has the specified property or not
@@ -42,3 +42,60 @@
Object.bindProperties=binds the source object's properties to the target object (nashorn extension)
+Array.isArray=tells whether the argument is an array
+
+Array.prototype.toString=returns a string representation of this array
+
+Array.prototype.assertNumeric=asserts that the array is numeric, throws a type error if this is not the case
+
+Array.prototype.toLocaleString=returns a locale-specific string representation of this array
+
+Array=creates a new array
+
+Array.prototype.concat=concatenates arrays
+
+Array.prototype.join=returns a string representation of the array, with a separator placed between elements
+
+Array.prototype.pop=returns the element from the end of the array, or undefined
+
+Array.prototype.push=appends an element to the end of the array
+
+Array.prototype.reverse=reverses the array
+
+Array.prototype.shift=removes the first element from the array and returns that element
+
+Array.prototype.slice=returns a shallow copy of a slice of the array
+
+Array.prototype.sort=sorts the array
+
+Array.prototype.splice=changes the content of the array by removing and/or adding elements
+
+Array.prototype.unshift=adds one or more elements to the beginning of the array
+
+Array.prototype.indexOf=retrieves the first index of an element in the array, or -1 if the element is not found
+
+Array.prototype.lastIndexOf=retrieves the last index of an element in the array, or -1 if the element is not found
+
+Array.prototype.every=applies a predicate to all elements of the array, returns true if the predicate evaluates to true for all
+
+Array.prototype.some=tests whether a predicate evaluates to true for some element in the array
+
+Array.prototype.forEach=applies a function to all elements in the array
+
+Array.prototype.map=applies a function to all elements in the array, returns the array of results
+
+Array.prototype.filter=returns an array with those elements from this array that match a filter function
+
+Array.prototype.reduce=applies a left-fold to the array and returns the result
+
+Array.prototype.reduceRight=applies a right-fold to the array and returns the result
+
+Function=creates a new function with the given parameters and function body
+
+Function.prototype.toString=returns a string representation of this function
+
+Function.prototype.apply=invokes the function with the given this-reference and arguments array
+
+Function.prototype.call=invokes the function with the given this-reference and arguments
+
+Function.prototype.bind=returns a new function with bound this-reference and arguments
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8147845.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8147845: Varargs Array functions still leaking longs
+ *
+ * @test
+ * @run
+ */
+
+Assert.assertTrue([].push() === 0);
+Assert.assertTrue([].unshift() === 0);
+Assert.assertTrue(typeof [].push() === 'number');
+Assert.assertTrue(typeof [].unshift() === 'number');
+
+Assert.assertTrue([].push(1, 2, 3) === 3);
+Assert.assertTrue([].unshift(1, 2, 3) === 3);
+Assert.assertTrue(typeof [].push(1, 2, 3) === 'number');
+Assert.assertTrue(typeof [].unshift(1, 2, 3) === 'number');
+
+Assert.assertTrue([].push(1) === 1);
+Assert.assertTrue([].unshift(1) === 1);
+Assert.assertTrue(typeof [].push(1) === 'number');
+Assert.assertTrue(typeof [].unshift(1) === 'number');
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/Hello.java Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * This is a test program used in the test jjs-option-cp.js
+ */
+public class Hello {
+ public Hello() {
+ }
+
+ public String getString() {
+ return "hello";
+ }
+}
--- a/nashorn/test/script/nosecurity/JDK-8144221.js Thu Jan 21 09:46:08 2016 -0800
+++ b/nashorn/test/script/nosecurity/JDK-8144221.js Thu Jan 21 10:17:48 2016 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
* Test that shebang handling works properly.
*
* @test
- * @runif os.not.windows
* @option -scripting
* @run
*/
@@ -126,8 +125,9 @@
}
function run(viajjs, name, arg1, arg2) {
- var prefix = viajjs ? "${jjs} -scripting " : ''
- $EXEC("${prefix}./shebang.js ${arg1} ${arg2}")
+ var prefix = viajjs ? "${jjs} -scripting " : win ? 'sh -c "' : '',
+ suffix = viajjs ? '' : win ? '"' : ''
+ $EXEC("${prefix}./shebang.js ${arg1} ${arg2}${suffix}")
print("* ${name} via ${viajjs ? 'jjs' : 'shebang'}")
print($OUT.trim())
print($ERR.trim())
@@ -143,8 +143,8 @@
$EXEC('chmod +x shebang.js')
run(false, 'noargs', '', '')
run(true, 'noargs', '', '')
- run(false, 'withargs', 'a.js', '"hello world"')
- run(true, 'withargs', 'a.js', '"hello world"')
+ run(false, 'withargs', 'a.js', "'hello world'")
+ run(true, 'withargs', 'a.js', "'hello world'")
$EXEC('rm shebang.js')
})
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-common.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @subtest
+ * @summary test used by all other jjs-option* test cases
+ */
+var javaHome = $ENV.JAVA_HOME,
+ homeJjs = "${javaHome}/bin/jjs",
+ altJjs = $EXEC('which jjs').trim(),
+ homejavac = "${javaHome}/bin/javac",
+ altjavac = $EXEC('which javac').trim()
+
+var Files = Java.type('java.nio.file.Files'),
+ Paths = Java.type('java.nio.file.Paths'),
+ System = Java.type('java.lang.System')
+
+// Initialize default values for variables used in different functions
+var func_cond_p = <<EOD
+$EXIT == 0
+EOD
+
+var func_cond_n = <<EOD
+$EXIT != 0
+EOD
+
+var flag_cond_p = <<EOD
+out == e_outp
+EOD
+
+var flag_cond_n = <<EOD
+out == e_outn
+EOD
+
+var e_outp = "true"
+var e_outn = "false"
+
+// special cases in which arguments used for negative testing also
+var args_p = "-scripting"
+var args_n = "-scripting"
+
+// create file to check -flag passing
+var path_f = Paths.get("temp-flag.js")
+var testflag_file = path_f.toAbsolutePath()
+
+// create file to check -flag functionality
+var path_func = Paths.get("temp-func.js")
+var testfunc_file = path_func.toAbsolutePath()
+
+
+function exists(f) {
+ return Files.exists(Paths.get(f))
+}
+
+var jjs = exists(homeJjs) ? homeJjs : altJjs
+var javac = exists(homejavac) ? homejavac : altjavac
+
+if (!exists(jjs)) {
+ throw "no jjs executable found; tried ${homeJjs} and ${altJjs}"
+}
+
+// write code to testflag_file
+function write_testflag_file() {
+ Files.write(testflag_file, msg_flag.getBytes())
+}
+
+// write code to testfunc_file
+function write_testfunc_file() {
+ Files.write(testfunc_file, msg_func.getBytes())
+}
+
+function flag_test_pass() {
+ print("flag test PASSED")
+}
+
+function flag_test_fail(e_out, out) {
+ print("flag test FAILED expected out:${e_out} found:${out}")
+}
+
+// check functionality of flag,cover both positive and negative cases
+function testjjs_opt_func(args, positive) {
+ $EXEC("${jjs} ${args}")
+ var out = $OUT.trim(),
+ err = $ERR.trim()
+ if (positive) {
+ if (eval(func_cond_p))
+ print("functionality test PASSED")
+ else
+ print("functionality test FAILED. stdout: ${out} -- stderr: ${err}")
+ }
+ else {
+ if (eval(func_cond_n))
+ print("functionality test PASSED")
+ else
+ print("functionality test FAILED. stdout: ${out} -- stderr: ${err}")
+ }
+
+}
+
+// check if corresponding $OPTIONS._XXX is set for given flag
+function testjjs_opt(args, type, func) {
+ $EXEC("${jjs} ${args}")
+ var out = $OUT.trim(),
+ err = $ERR.trim()
+ if (type) {
+ if (eval(flag_cond_p)) {
+ flag_test_pass()
+ if (func)
+ testjjs_opt_func(arg_p, type)
+ }
+ else {
+ flag_test_fail(e_outp, out)
+ }
+ }
+ else {
+ if (eval(flag_cond_n)) {
+ flag_test_pass()
+ if (func)
+ testjjs_opt_func(arg_n, type)
+ }
+ else {
+ flag_test_fail(e_outn, out)
+ }
+ }
+}
+
+// Main entry point to test both flag and its functionality
+function testjjs_flag_and_func(flag, param) {
+ try {
+ var args = "${flag}" + "${param}"
+ write_testflag_file()
+ write_testfunc_file()
+ print("${flag} flag positive test:")
+ testjjs_opt("${args_p} ${args} ${testflag_file}", true, true) // positive test
+ print("${flag} flag negative test:")
+ testjjs_opt("${args_n} ${testflag_file}", false, true) // negative test
+ } finally {
+ $EXEC("rm ${testflag_file}")
+ $EXEC("rm ${testfunc_file}")
+ }
+}
+
+// Main entry point to check only functionality of given -flag
+function testjjs_functionality(flag, param) {
+ try {
+ var args = "${flag}" + "${param}"
+ write_testfunc_file()
+ print("${flag} flag positive test:")
+ testjjs_opt_func("${args_p} ${args} ${testfunc_file}", true) // positive test
+ print("${flag} flag negative test:")
+ testjjs_opt_func("${args_n} ${testfunc_file}", false) // negative test
+ } finally {
+ $EXEC("rm ${testfunc_file}")
+ }
+}
+
+// Main entry point to check only -flag settings for given flag
+function testjjs_flag(flag, param) {
+ try {
+ var args = "${flag}" + "${param}"
+ write_testflag_file()
+ print("${flag} flag positive test:")
+ testjjs_opt("${args_p} ${args} ${testflag_file}", true, false) // positive test
+ print("${flag} flag negative test:")
+ testjjs_opt("${args_n} ${testflag_file}", false, false) // negative test
+ } finally {
+ $EXEC("rm ${testflag_file}")
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-cp.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test to check if -cp flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+var hello = __DIR__ + "Hello.class";
+var helloj = __DIR__ + "Hello.java";
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._classpath)"
+
+// code to check basic functionality
+var msg_func = <<EOD
+$EXEC("rm -f ${hello}")
+$EXEC("${javac} ${helloj}")
+var v = new Packages.Hello();
+if (v.string != 'hello') {
+ throw new Error("Unexpected property value");
+}
+EOD
+
+// flag test expected output variables
+var e_outp = "__DIR__"
+var e_outn = "null"
+
+// functionality test arguments
+var arg_p = "-scripting -cp ${__DIR__} ${testfunc_file}"
+var arg_n = "-scripting ${testfunc_file}"
+
+// Testing starts here
+testjjs_flag_and_func("-cp", " __DIR__")
+$EXEC("rm -f ${hello}")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-cp.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+-cp flag positive test:
+flag test PASSED
+functionality test PASSED
+-cp flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-define.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test to check -D flag basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+var path_func = Paths.get("temp-property-func.js")
+var testfunc_file = path_func.toAbsolutePath()
+
+// code to check basic functionality
+var msg_func = <<EOD
+try {
+ var System = Java.type('java.lang.System');
+ print(System.getProperty('user.name'))
+ if (System.getProperty('user.name') != "nashorn9")
+ throw new Error("un expected system property user.name value")
+} finally {
+}
+EOD
+
+// Testing starts here
+testjjs_functionality("-D", "user.name=nashorn9")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-define.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,4 @@
+-D flag positive test:
+functionality test PASSED
+-D flag negative test:
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-doe.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -doe flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._dump_on_error)"
+
+// code to check basic functionality
+var msg_func = <<EOD
+print("Hello Nashorn)
+EOD
+
+// flag test expected output variables
+var e_outp = "true"
+var e_outn = "false"
+
+// functionality test arguments
+var arg_p = "-scripting -doe ${testfunc_file}"
+var arg_n = "-scripting ${testfunc_file}"
+
+// functionality condition checks used.
+var func_cond_p = <<'EOD'
+err.indexOf("internal") > -1
+EOD
+
+var func_cond_n = <<'EOD'
+err.indexOf("internal") <= -1
+EOD
+
+// one particular test starts here
+testjjs_flag_and_func("-doe", "")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-doe.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+-doe flag positive test:
+flag test PASSED
+functionality test PASSED
+-doe flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-fv.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test if -fv flag its basic funnctionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._fullversion)"
+
+// code to check basic functionality
+var msg_func = <<EOD
+var x = "Hello Nashorn"
+EOD
+
+// flag test expected output variables
+var e_outp = "true"
+var e_outn = "false"
+
+// functionality test arguments
+var arg_p = "-scripting -fv ${testfunc_file}"
+var arg_n = "-scripting ${testfunc_file}"
+
+var func_cond_p = <<'EOD'
+err.indexOf("full") > -1
+EOD
+
+var func_cond_n = <<'EOD'
+err.indexOf("full") <= -1
+EOD
+
+// one particular test starts here
+testjjs_flag_and_func("-fv", "")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-fv.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+-fv flag positive test:
+flag test PASSED
+functionality test PASSED
+-fv flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-fx.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * check -fx option.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -fx flag and its basic functionality
+ * the JavaFX primary stage is available to Nashorn as a global property $STAGE with -fx
+ * used this to check with and without -fx
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+var msg_flag = "print(typeof($STAGE));";
+
+// flag test expected output variables
+var e_outn = "undefined"
+
+// positive flag test condition expression string other than the default
+var flag_cond_p = <<'EOD'
+out != "undefined"
+EOD
+
+// Testing starts here
+testjjs_flag("-fx","")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-fx.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,4 @@
+-fx flag positive test:
+flag test PASSED
+-fx flag negative test:
+flag test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-lang.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -lang flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._es6)"
+
+// code to check basic functionality
+var msg_func = <<EOD
+const X = 4
+try {
+ X = 55
+ throw new Error("should have thrown TypeError")
+} catch (e) {
+ if (!(e instanceof TypeError)) {
+ throw new Error("TypeError expected, got " + e)
+ }
+}
+EOD
+
+// flag test expected output variables
+var e_outp = "true"
+var e_outn = "false"
+
+// functionality test arguments
+var arg_p = "-scripting --language=es6 ${testfunc_file}"
+var arg_n = "-scripting ${testfunc_file}"
+
+// Testing starts here
+testjjs_flag_and_func("--language", "=es6")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-lang.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+--language flag positive test:
+flag test PASSED
+functionality test PASSED
+--language flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-ot.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -ot flag
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+var args_n = "-scripting -ot=false"
+var msg_flag = "print($OPTIONS._optimistic_types);";
+
+// flag test expected output variables
+var e_outp = "true"
+var e_outn = "false"
+
+// Testing starts here
+testjjs_flag("-ot","")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-ot.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,4 @@
+-ot flag positive test:
+flag test PASSED
+-ot flag negative test:
+flag test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-scripting.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -scripting flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._scripting)"
+
+// code to check basic functionality
+var msg_func = <<'EOD'
+var x = "Nashorn"
+var hello = "Hello ${x}"
+if (hello != "Hello Nashorn") {
+ throw new Error("string interploation not working");
+}
+EOD
+
+// flag test expected output variables
+var e_outn = 'ReferenceErrorr: "$OPTIONS" is not defined'
+// negative flag test condition
+var flag_cond_n = 'err.indexOf("$OPTIONS") > -1'
+
+// functionality test arguments
+var arg_p = "-scripting ${testfunc_file}"
+var arg_n = "${testfunc_file}"
+
+var args_p = "",
+ args_n = ""
+
+// Testing starts here
+testjjs_flag_and_func("-scripting", "")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-scripting.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+-scripting flag positive test:
+flag test PASSED
+functionality test PASSED
+-scripting flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-strict.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -strict flag and its basic functionality
+ */
+
+load(__DIR__ + "jjs-common.js")
+
+// code to check -flag
+var msg_flag = "print($OPTIONS._strict)"
+
+// code to check basic functionality
+var msg_func = <<EOD
+try {
+ v = "nashorn"
+ throw new Error("should have thrown reference error")
+} catch (e) {
+ if (!(e instanceof ReferenceError)) {
+ throw new Error("ReferenceError expected, got " + e)
+ }
+}
+EOD
+
+// functionality test arguments
+var arg_p = "-scripting -strict ${testfunc_file}"
+var arg_n = "-scripting ${testfunc_file}"
+
+// Testing starts here
+testjjs_flag_and_func("-strict","")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-strict.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,6 @@
+-strict flag positive test:
+flag test PASSED
+functionality test PASSED
+-strict flag negative test:
+flag test PASSED
+functionality test PASSED
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-version.js Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8144113: Nashorn: enable jjs testing.
+ * check if jjs version is same as of java.
+ * @test
+ * @option -scripting
+ * @runif os.not.windows
+ * @run
+ * @summary Test -version flag and its functionality
+ */
+
+
+load(__DIR__ + "jjs-common.js")
+
+var javaVersion = System.getProperty('java.version')
+
+// code to check -flag
+var msg_flag = 'var x = "Hello Nashorn"'
+
+// flag test expected output variables
+var e_outp = "nashorn ${javaVersion}"
+var e_outn = "Hello Nashorn"
+
+// not sure why version info is found in error stream not in out stream.??
+flag_cond_p = "err.indexOf(e_outp)> -1"
+flag_cond_n = "err.indexOf(e_outp)<= -1"
+
+testjjs_flag("-version","")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/nosecurity/jjs-option-version.js.EXPECTED Thu Jan 21 10:17:48 2016 -0800
@@ -0,0 +1,4 @@
+-version flag positive test:
+flag test PASSED
+-version flag negative test:
+flag test PASSED