Request for review JDK-8010706 - system properties -> nashorn options

A. Sundararajan sundararajan.athijegannathan at oracle.com
Tue Mar 26 00:06:20 PDT 2013


+1

PS. Do we need to update developer docs?

-Sundar

On Tuesday 26 March 2013 12:12 PM, Marcus Lagergren wrote:
> In order to make opaque frameworks easier to debug, I've added some code to Options.java that converts system properties given by the value of the property "nashorn.args" to nashorn parameters. This way we can set e.g. "--log=compiler" for something that runs three levels deep in JavaScript meta-execution frameworks without knowing exactly how they launch.
>
> Usage example:
>
> export  nashorn.args="--lazy-compilation --log=compiler" mvn clean verify
>
> Patch:
>
> diff -r d5d80b52cf1c src/jdk/nashorn/internal/runtime/options/Options.java
> --- a/src/jdk/nashorn/internal/runtime/options/Options.java	Fri Mar 15 16:07:13 2013 +0100
> +++ b/src/jdk/nashorn/internal/runtime/options/Options.java	Tue Mar 19 18:16:36 2013 +0100
> @@ -386,6 +386,13 @@
>          final LinkedList<String> argList = new LinkedList<>();
>          Collections.addAll(argList, args);
>
> + final String extra = getStringProperty("nashorn.args", null);
> +     if (extra != null) {
> +          for (final StringTokenizer st = new StringTokenizer(extra); st.hasMoreTokens(); ) {
> +              argList.add(st.nextToken());
> +          }
> + }
> +
>          while (!argList.isEmpty()) {
>              final String arg = argList.remove(0);
>
> @@ -406,7 +413,7 @@
>                  files.add(arg);
>                  continue;
>              }
> -
> +
>              if (arg.startsWith(definePropPrefix)) {
>                  final String value = arg.substring(definePropPrefix.length());
>                  final int eq = value.indexOf('=');
>
> /M
>



More information about the nashorn-dev mailing list