What about JSObject? Object.prototype.hasOwnProperty.call(obj, prop)

2016-11-20 Thread Art Fiedler
In UglifyJS2 they use Object.prototype.hasOwnProperty.call(obj, prop) to determine if the object has that property defined, others like LessCss use obj.hasOwnProperty(prop) so I was previously able to avoid implementing JSObject and just add a hasOwnProperty method onto my POJO... but in UglifyJS2

JavaScript Array slot/member == undefined instead of null?

2016-11-30 Thread Art Fiedler
@Sundararajan, I was previously using .getSlot(index) when extracting items from a ScriptObjectMirror when that mirror was an array until I ran into a undefined element and that is not equal to null as I had for my condition... so I swapped .getSlot(i) with .get(Integer.toString(i)) Are

JSObject call() is passed undefined/null for the argument 'thiz'?

2016-11-30 Thread Art Fiedler
@Sundararajan When calling the following code, I expected the call to myJSObject inside testJSOCall to pass the current scope as a ScriptObjectMirror to JSObjectImpl's call method as the thiz argument. In this case without modifying the call to myJSObject() should 'this' automatically be passed

Confusing ScriptObjectMirror size() vs mirror.get("length")

2016-11-30 Thread Art Fiedler
@Sundararajan When looping an array in javascript I would typically do something like this... for(var i = 0; i < arr.length; i++) { console.log('Index: ' + i + ' = ' + arr[i]); } When looping a javascript array using the ScriptObjectMirror I would initially think to use the same

Undefined should be part of the exposed nashorn API

2016-11-30 Thread Art Fiedler
@Sundararajan I ran into an issue with a JSObject I implemented and some code in LessCSS. The team is likely aware by now of a need to return Undefined from JSObject's getMember() and possibly call(), and getSlot()... You had previously asked a long time ago why someone would want to do that and

Error Stack Column number

2016-11-30 Thread Art Fiedler
When making an implementation of console.count([label]) part of the Mozilla's developer docs https://developer.mozilla.org/en-US/docs/Web/API/Console/count mentions when label is omitted, the function will count the number of times count() was called on that line... however, if the javascript

SourceMaps

2016-12-02 Thread Art Fiedler
A long time from now, in a galaxy far, far away... jdk9 came today 07/27/2017 :) I definitely do believe it's an important feature, most web tech now a days supports source maps and a portion of the open source project I'm working on uses a source transformer to inject some Interrupt checks among

What about JSObject? Object.prototype.hasOwnProperty.call(obj, prop)

2016-12-02 Thread Art Fiedler
Thanks for pointing out the alternative, I hadn't thought of that option. However. ;) I would still argue this as a bug or overlooked. I understand JSObject is not intended to be a real ScriptObject with a prototype etc. However let me ask you the difference between hasMember and hasOwnProperty?

Error Stack Column number

2016-12-02 Thread Art Fiedler
Your right it's still not standard even in the EMCAScript 2016, it just seems to be the commonality. When thinking java yes line only makes sense as typically one who writes java does not minify the code. When thinking javascript however minified code is quite normal and myfile:1 might mean 5000

Confusing ScriptObjectMirror size() vs mirror.get("length")

2016-12-02 Thread Art Fiedler
Thanks for making it more confusing! ;) The reason I used array.get(iStr) instead of array.getSlot(I) just happened to be because of my previous post about array.getSlot() returning the undefined object. I should however have used getSlot in this example to make it more clear that I knew I was

Re: Error Stack Column number

2016-12-02 Thread Art Fiedler
As java > StackTraceElement objects do not have column number, we can't populate > column number. > > -Sundar > > On 12/2/2016 2:06 PM, Art Fiedler wrote: > > Your right it's still not standard even in the EMCAScript 2016, it just > > seems to > > be the com

SourceMaps

2016-11-30 Thread Art Fiedler
Would be nice to provide SourceMaps to the ScriptEngine... I've seen here... http://stackoverflow.com/questions/35137455/nashorn-use-of-source-maps That nashorn doesn't support source maps, and I'm sure there is a library out there that is catching the exception and formatting it before it

Re: Error Stack Column number

2016-12-02 Thread Art Fiedler
e done without hurting performance) we'd be > happy to accept contributions. > > -Sundar > > > On 12/2/2016 4:34 PM, Art Fiedler wrote: > > Without knowing all the internals of nashorn. I don't know if an internal > > calling tree exists or how complicated it woul