-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8u66
-
x86
-
windows_8
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
When writing a shebang (#!) at the beginning of a jjs script, one can pass parameters & arguments. However, currently only a few parameters are supported.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- create a script test.js with the content as given in the "Source code" field
- run the script on a Windows host with the command:
jjs test.js
- run the script again, with the command:
jjs --language=es6 test.js
(note: it has to be on a Windows host, because I used "notepad" in the script to test the "-scripting" parameter)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the script must fail on line 4 both times
ACTUAL -
with "jjs test.js", the script incorrectly fails on line 16
with "jjs --language=es6 test.js", the script incorrectly passes
these results prove that, currently, the only command-line parameter which is supported, is "-scripting". All other command-line parameters must be supported as well.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
#!jjs --no-syntax-extensions -strict --no-java -scripting --language=es6
// --no-syntax-extensions
var x = function(x) x*x;
// -strict
someVar = 2;
// --no-java
Java.type("java.lang.System");
// -scripting
$EXEC("notepad");
// --language=es6
var p = `a
b`;
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
When writing a shebang (#!) at the beginning of a jjs script, one can pass parameters & arguments. However, currently only a few parameters are supported.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- create a script test.js with the content as given in the "Source code" field
- run the script on a Windows host with the command:
jjs test.js
- run the script again, with the command:
jjs --language=es6 test.js
(note: it has to be on a Windows host, because I used "notepad" in the script to test the "-scripting" parameter)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the script must fail on line 4 both times
ACTUAL -
with "jjs test.js", the script incorrectly fails on line 16
with "jjs --language=es6 test.js", the script incorrectly passes
these results prove that, currently, the only command-line parameter which is supported, is "-scripting". All other command-line parameters must be supported as well.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
#!jjs --no-syntax-extensions -strict --no-java -scripting --language=es6
// --no-syntax-extensions
var x = function(x) x*x;
// -strict
someVar = 2;
// --no-java
Java.type("java.lang.System");
// -scripting
$EXEC("notepad");
// --language=es6
var p = `a
b`;
---------- END SOURCE ----------
- duplicates
-
JDK-8144221 fix Nashorn shebang argument handling on Mac/Linux
-
- Resolved
-