提交 207b15cc 编写于 作者: S sundar

8016550: nashorn.option.no.syntax.extensions has the wrong default

Reviewed-by: hannesw, lagergren
上级 c2703710
......@@ -193,7 +193,8 @@ test262-test-sys-prop.test.js.enable.strict.mode=true
# 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
......
......@@ -72,7 +72,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
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);
......
......@@ -2403,7 +2403,7 @@ loop:
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);
}
}
......
......@@ -56,9 +56,6 @@ public final class ScriptEnvironment {
/** 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 @@ public final class ScriptEnvironment {
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");
......
......@@ -59,7 +59,7 @@ nashorn.options.D.key = nashorn.option.D
## 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 @@ nashorn.option.xhelp = { \
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.loader.per.compile = { \
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.strict = { \
nashorn.option.scripting = { \
name="-scripting", \
desc="Enable scripting features.", \
dependency="--anon-functions=true" \
desc="Enable scripting features." \
}
nashorn.option.specialize.calls = { \
......
......@@ -25,7 +25,6 @@
* This loads "module.js" and calls the anonymous top-level function from it.
*
* @test
* @option --anon-functions
* @run
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册