Re: Surprising Nashorn behavior for String methods

2016-10-17 Thread Sundararajan Athijegannathan
Hi Andreas, Well, it is as of ES 6.0. For the most part, Nashorn still is only 5.1 compliant with few ES6 items thrown in jdk 9. Also, my answer was generic in the sense that there are function properties available which are not in prototype [because of java extension]. -Sundar On 10/17/2016 1

Re: Surprising Nashorn behavior for String methods

2016-10-16 Thread Emilian Bold
@Andreas: But Nashorn on JDK 8 does not implement ECMAScript 6. --emi On Mon, Oct 17, 2016 at 8:22 AM, Andreas Rieber wrote: > Hi Sundar, > > startsWith is part of ECMAScript: > > http://www.ecma-international.org/ecma-262/6.0/#sec-string.p > rototype.startswith > > Not widely supported... > >

Re: Surprising Nashorn behavior for String methods

2016-10-16 Thread Andreas Rieber
Hi Sundar, startsWith is part of ECMAScript: http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.startswith Not widely supported... cheers Andreas On 17/10/2016 06:48, Sundararajan Athijegannathan wrote: Hi, "startsWith" is non-standard extension (actually, it is Java meth

Re: Surprising Nashorn behavior for String methods

2016-10-16 Thread Sundararajan Athijegannathan
Hi, "startsWith" is non-standard extension (actually, it is Java method) jjs> "hello".startsWith [jdk.internal.dynalink.beans.OverloadedDynamicMethod java.lang.String.startsWith] "startsWith" is not an ECMAScript standard specified property of String.prototype. In Nashorn, you can call methods

Surprising Nashorn behavior for String methods

2016-10-16 Thread Esben Andreasen
Hi I am not sure if this is a bug or feature of the Nashorn engine. But it looks like some String-prototype methods are missing, yet the methods are somehow present when used in the right way. Minimal example: calling `startsWith` by using `call`: ``` 1 $ jjs -v 2 jjs> String.prototype.startsW