This commit is contained in:
Lana Steuck 2016-05-05 19:10:51 +00:00
commit 19f9ce673f
8 changed files with 81 additions and 29 deletions

View File

@ -42,7 +42,7 @@
destdir="${build.classes.dir}"
debug="${javac.debug}"
includeantruntime="false" fork="true">
<compilerarg value="-XaddExports:${nasgen.module.imports}"/>
<compilerarg line="${nasgen.module.imports}"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-XDignore.symbol.file"/>

View File

@ -40,8 +40,8 @@ dist.javadoc.dir=${dist.dir}/javadoc
javac.debug=true
nasgen.module.imports=\
java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED,\
java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
-XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
meta.inf.dir=${src.dir}/META-INF
run.classpath=\

View File

@ -76,9 +76,10 @@ NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
ifeq ($(BOOT_JDK_MODULAR), true)
NASGEN_OPTIONS := \
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-Xpatch:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-Xpatch:java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
-XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
#
else
NASGEN_OPTIONS := \
-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes

View File

@ -36,7 +36,7 @@
<pathelement location="${basedir}/jcov2/lib/jcov_j2se_rt.jar"/>
<pathelement location="${basedir}/buildtools/nasgen/dist/nasgen.jar"/>
</classpath>
<jvmarg value="-XaddExports:${nasgen.module.imports}"/>
<jvmarg line="${nasgen.module.imports}"/>
<arg value="${nashorn.module.classes.dir}"/>
<arg value="jdk.nashorn.internal.objects"/>
<arg value="${nashorn.module.classes.dir}"/>

View File

@ -35,7 +35,6 @@
<path id="nashorn.jar.path">
<pathelement location="${nashorn.jar}"/>
</path>
<property name="nashorn.override.option" value="-Xpatch:${build.classes.dir}"/>
<condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
<available file="/usr/local/bin/svn"/>
</condition>
@ -176,6 +175,10 @@
<compilerarg value="-Xdiags:verbose"/>
<compilerarg value="-parameters"/>
</javac>
<!-- -Xpatch does not like module-info.class files! -->
<delete>
<fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
</delete>
<javac srcdir="${nashorn.module.src.dir}"
destdir="${nashorn.module.classes.dir}"
source="${javac.source}"
@ -187,8 +190,12 @@
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xdiags:verbose"/>
<compilerarg value="-parameters"/>
<compilerarg value="${nashorn.override.option}"/>
<compilerarg line="${nashorn.override.option}"/>
</javac>
<!-- -Xpatch does not like module-info.class files! -->
<delete>
<fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
</delete>
<javac srcdir="${nashorn.shell.module.src.dir}"
destdir="${nashorn.shell.module.classes.dir}"
source="${javac.source}"
@ -200,7 +207,7 @@
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xdiags:verbose"/>
<compilerarg value="-parameters"/>
<compilerarg value="${nashorn.override.option}"/>
<compilerarg line="${nashorn.override.option}"/>
</javac>
<!-- -Xpatch does not like module-info.class files! -->
<delete>
@ -348,11 +355,11 @@
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
<compilerarg value="${nashorn.override.option}"/>
<compilerarg line="${nashorn.override.option}"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xdiags:verbose"/>
<compilerarg value="-XaddExports:${test.module.imports}"/>
<compilerarg line="${test.module.imports}"/>
</javac>
<copy todir="${build.test.classes.dir}/META-INF/services">

View File

@ -47,6 +47,11 @@ build.classes.dir=${build.dir}/classes
build.zip=${build.dir}/nashorn.zip
build.gzip=${build.dir}/nashorn.tar.gz
nashorn.override.option=\
-Xpatch:jdk.scripting.nashorn=${build.classes.dir}/jdk.scripting.nashorn \
-Xpatch:jdk.scripting.nashorn.shell=${build.classes.dir}/jdk.scripting.nashorn.shell \
-Xpatch:jdk.dynalink=${build.classes.dir}/jdk.dynalink
# project directory of <nashorn> ant task
nashorntask.dir=buildtools/nashorntask
@ -57,8 +62,8 @@ nashorn.shell.tool=jdk.nashorn.tools.Shell
nasgen.tool=jdk.nashorn.internal.tools.nasgen.Main
nasgen.module.imports=\
java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED,\
java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
-XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
# parallel test runner tool
parallel.test.runner=jdk.nashorn.internal.test.framework.ParallelTestRunner
@ -132,19 +137,19 @@ javac.test.classpath=\
${file.reference.snakeyaml.jar}
test.module.imports=\
jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED,\
jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED,\
java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
-XaddExports:jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
-XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
meta.inf.dir=${nashorn.module.src.dir}/META-INF
@ -342,8 +347,8 @@ run.test.user.country=TR
run.test.jvmargs.common=\
-server \
-XaddExports:${test.module.imports} \
-Xpatch:${build.classes.dir} \
${test.module.imports} \
${nashorn.override.option} \
-Dfile.encoding=UTF-8 \
-Duser.language=${run.test.user.language} \
-Duser.country=${run.test.user.country} \

View File

@ -8,4 +8,7 @@ keys=intermittent randomness
groups=TEST.groups
# Minimum jtreg version
requiredVersion=4.2 b01
requiredVersion=4.2 b02
# Use new form of -Xpatch
useNewXpatch=true

View File

@ -0,0 +1,36 @@
/*
* 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-8144711: (x) => x + 1 causes Assertion failure instead of SyntaxError
*
* @test
* @run
*/
try {
eval("(x) => x + 1");
throw new Error ("should not reach here");
} catch (e) {
Assert.assertTrue(e instanceof SyntaxError);
}