Re: Bug in NashornScriptEngineFactory.getOutputStatement(...) with a possible fix (Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2019-11-05 Thread Rony G. Flatscher
Hmm, the formatting of the offered fix was mangled (had used a format which was obviously not o.k.). So here another attempt to present the code in a way that makes it hopefully easy to copy and paste (in a fixed pitch the ".replace(...)" invocations are aligned to the same column): - code

Bug in NashornScriptEngineFactory.getOutputStatement(...) with a possible fix (Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2019-11-05 Thread Rony G. Flatscher
Almost two years ago I brought up a bug in NashornScriptEngineFactory.getOutputStatement(String). Further attention obviously stopped with the question where an appropriate place would be to file a bug. The bug is caused by not quoting and escaping the passed string such that a proper JavaScrip

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-07 Thread Rony G. Flatscher
On 07.01.2017 15:02, Edmond Kemokai wrote: > Ah, I see your point. > > I'll say file a bug. If you look at the NashornScriptEngineFactory.java, > you'll see that it simply > concatenates the supplied string between a print statement, the current > implementation requires > proper escaping of in

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-07 Thread Edmond Kemokai
Ah, I see your point. I'll say file a bug. If you look at the NashornScriptEngineFactory.java, you'll see that it simply concatenates the supplied string between a print statement, the current implementation requires proper escaping of input. On Jan 7, 2017 8:52 AM, "Rony G. Flatscher" wrote:

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-07 Thread Rony G. Flatscher
Hi Ed, On 06.01.2017 17:49, Edmond Kemokai wrote: > The issue seems to go away after I quote the string. If you supplied a Javascript encoded string to the Nashorn ScriptEngineFactory.getOutputStatement() you removed the cause of demonstrating that Nashorn ScriptEngineFactory creates wrong outpu

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-06 Thread Edmond Kemokai
The issue seems to go away after I quote the string. You can run the code in the browser by right clicking and choosing "Test" then click "Run". On the top right, click the dropdown button and choose "Log Viewer" to see the output. Ouput: INFO Invocation - ---> language [EC

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-06 Thread Rony G. Flatscher
Hi Ed, On 06.01.2017 16:07, Edmond Kemokai wrote: > > I am the developer of HiveMind, it is a web app platform that relies entirely > on scripting engines > via JSR-223. > > You can access a demo instance: http://demo.crudzilla.com:7000/ > > Login with: develope

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-06 Thread Edmond Kemokai
Hi Rony, I am the developer of HiveMind, it is a web app platform that relies entirely on scripting engines via JSR-223. You can access a demo instance: http://demo.crudzilla.com:7000/ Login with: developer/developer I have created a test file in: /com/crudzilla/cloudTest/web/rony-groovy.ste Pu

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2017-01-06 Thread Rony G. Flatscher
Besides Java 1.8.0_111 the problem exists in 9ea-+134 (engine version: "9ea", language version: "ECMA 262 - Edition 5.1" ) as well: Nashorn's javax.script factory is used to get an output statement and then it is used to execute it: ---> language [ECMAScript]: ---

Re: Nashorn's javax.script.ScriptEngineFactory produces wrong code

2016-12-08 Thread Rony G. Flatscher
Unfortunately, the mailing list seems to behave as if it was running in the 1970's such that the formatted text (indented, partially colorized and formatted to preformat and Courier) has turned to become illegible, unfortunately (using the Thunderbird e-Mail client)! :( The meat is right in the

Nashorn's javax.script.ScriptEngineFactory produces wrong code

2016-12-08 Thread Rony G. Flatscher
Hi there, was directed to this list to report an error with Nashorn's implementation of javax.script.ScriptEngineFactory.getOutputStatement(String toDisplay). The test is simple: one supplies a string, containing double quotes, and immediately use the Nashort script engine to carry out the outpu