changeset 355:a2fa56222fa2

8016550: nashorn.option.no.syntax.extensions has the wrong default Reviewed-by: hannesw, lagergren
author sundar
date Mon, 17 Jun 2013 13:56:05 +0530
parents 3d947baa33cc
children bfac80dffc49 616ab697fcac
files make/project.properties src/jdk/nashorn/api/scripting/NashornScriptEngine.java src/jdk/nashorn/internal/parser/Parser.java src/jdk/nashorn/internal/runtime/ScriptEnvironment.java src/jdk/nashorn/internal/runtime/resources/Options.properties test/script/basic/moduleload.js
diffstat 6 files changed, 9 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/make/project.properties	Fri Jun 14 21:16:14 2013 +0530
+++ b/make/project.properties	Mon Jun 17 13:56:05 2013 +0530
@@ -193,7 +193,8 @@
 
 # list of test262 test dirs to be excluded
 test262-test-sys-prop.test.js.exclude.dir=\
-    ${test262.suite.dir}/intl402/
+    ${test262.suite.dir}/intl402/ \
+    ${test262.suite.dir}/bestPractice/ 
 
 test262-test-sys-prop.test.failed.list.file=${build.dir}/test/failedTests
 
--- a/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Jun 14 21:16:14 2013 +0530
+++ b/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Mon Jun 17 13:56:05 2013 +0530
@@ -72,7 +72,7 @@
     private final ScriptObject        global;
 
     // default options passed to Nashorn Options object
-    private static final String[] DEFAULT_OPTIONS = new String[] { "-scripting", "-af", "-doe" };
+    private static final String[] DEFAULT_OPTIONS = new String[] { "-scripting", "-doe" };
 
     NashornScriptEngine(final NashornScriptEngineFactory factory, final ClassLoader appLoader) {
         this(factory, DEFAULT_OPTIONS, appLoader);
--- a/src/jdk/nashorn/internal/parser/Parser.java	Fri Jun 14 21:16:14 2013 +0530
+++ b/src/jdk/nashorn/internal/parser/Parser.java	Mon Jun 17 13:56:05 2013 +0530
@@ -2403,7 +2403,7 @@
             verifyStrictIdent(name, "function name");
         } else if (isStatement) {
             // Nashorn extension: anonymous function statements
-            if (env._no_syntax_extensions || !env._anon_functions) {
+            if (env._no_syntax_extensions) {
                 expect(IDENT);
             }
         }
--- a/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Fri Jun 14 21:16:14 2013 +0530
+++ b/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Mon Jun 17 13:56:05 2013 +0530
@@ -56,9 +56,6 @@
     /** Current Options object. */
     private final Options options;
 
-    /** Always allow functions as statements */
-    public final boolean _anon_functions;
-
     /** Size of the per-global Class cache size */
     public final int     _class_cache_size;
 
@@ -192,7 +189,6 @@
         this.namespace = new Namespace();
         this.options = options;
 
-        _anon_functions       = options.getBoolean("anon.functions");
         _class_cache_size     = options.getInteger("class.cache.size");
         _compile_only         = options.getBoolean("compile.only");
         _debug_lines          = options.getBoolean("debug.lines");
--- a/src/jdk/nashorn/internal/runtime/resources/Options.properties	Fri Jun 14 21:16:14 2013 +0530
+++ b/src/jdk/nashorn/internal/runtime/resources/Options.properties	Mon Jun 17 13:56:05 2013 +0530
@@ -59,7 +59,7 @@
 ## is_undocumented - should this option never appear in the online help. defaults to no.
 ## desc - description of what the option does
 ## default - default value of the option. e.g. debug.lines is true by default. Not set means option not available by default
-## dependency - does this arg imply another arg, e.g. scripting -> anon-functions
+## dependency - does this arg imply another arg.
 ## confict - does this arg conflict with another arg e.g trace && instrument
 ## value_next_arg - is the opton's value passed as next argument in command line?
 ##
@@ -77,16 +77,9 @@
     desc="Print extended help for command line flags." \
 }
 
-nashorn.option.anon.functions = {                \
-    name="--anon-functions",                     \
-    short_name="-af",                            \
-    is_undocumented=true,                        \
-    desc="Always allow functions as statements." \
-}
-
 nashorn.option.class.cache.size ={                            \
     name="--class-cache-size",                                \
-    short_name="--ccs",                                       \
+    short_name="-ccs",                                        \
     desc="Size of the Class cache size per global scope.",    \
     is_undocumented=true,                                     \
     type=Integer,                                             \
@@ -201,10 +194,10 @@
 
 nashorn.option.no.syntax.extensions = {            \
     name="--no-syntax-extensions",                 \
-    short_name="--nse",                            \
+    short_name="-nse",                             \
     is_undocumented=true,                          \
     desc="No non-standard syntax extensions",      \
-    default=-anon-functions=false                  \
+    default=false                                  \
 }
 
 nashorn.option.package = {                                     \
@@ -296,8 +289,7 @@
 
 nashorn.option.scripting = {            \
     name="-scripting",                  \
-    desc="Enable scripting features.",	\
-    dependency="--anon-functions=true"  \
+    desc="Enable scripting features."   \
 }
 
 nashorn.option.specialize.calls = {                                                \
--- a/test/script/basic/moduleload.js	Fri Jun 14 21:16:14 2013 +0530
+++ b/test/script/basic/moduleload.js	Mon Jun 17 13:56:05 2013 +0530
@@ -25,7 +25,6 @@
  * This loads "module.js" and calls the anonymous top-level function from it.
  *
  * @test
- * @option --anon-functions
  * @run
  */