# HG changeset patch # User sundar # Date 1371457565 -19800 # Node ID 1b5fdae617cff012a93327e5a5b67baa30a1fa84 # Parent 47413e8d71b558b99f5c71d7d455818736d7a0eb 8016550: nashorn.option.no.syntax.extensions has the wrong default Reviewed-by: hannesw, lagergren diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/make/project.properties --- a/nashorn/make/project.properties Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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 diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java --- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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); diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/src/jdk/nashorn/internal/parser/Parser.java --- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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); } } diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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"); diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties --- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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 = { \ diff -r 47413e8d71b5 -r 1b5fdae617cf nashorn/test/script/basic/moduleload.js --- a/nashorn/test/script/basic/moduleload.js Fri Jun 14 21:16:14 2013 +0530 +++ b/nashorn/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 */