It's great being able to run pods and tests in JS from the command line:
C:\> fan compilerJs::Runner afAwesome
C:\> fant -js afAwesome
But I ran into errors when running Java8.
Digging around the JS code, I found several references to a global println method. It seems println is no longer supported in Nashorn and Java8 (but it was in Rhino and Java6). Nashorn does support print though:
C:\> jdk1.8.0_65\bin\jjs
jjs> print("Hello")http://fantom.org/forum/new/#
Hello
jjs> println("Hello")
<shell>:1 ReferenceError: "println" is not defined
So below is a small patch which simply replaces the 5 occurrences of println with print:
SlimerDude Thu 25 Feb 2016
It's great being able to run pods and tests in JS from the command line:
But I ran into errors when running Java8.
Digging around the JS code, I found several references to a global
println
method. It seemsprintln
is no longer supported in Nashorn and Java8 (but it was in Rhino and Java6). Nashorn does supportprint
though:So below is a small patch which simply replaces the 5 occurrences of
println
withprint
:andy Thu 25 Feb 2016
I assume
print
is supported < 1.8 - so that patch is backwards compatible?SlimerDude Thu 25 Feb 2016
Yeah,
print
is supported by Rhino and Java 6, see:http://stackoverflow.com/questions/10009620/how-do-i-output-something-in-rhino
https://github.com/mozilla/rhino/blob/master/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L178
andy Fri 26 Feb 2016
Thanks Steve - merged