rhino 1.7R2

2009-03-04 Thread Rhino user
When can we expect release of 1.7R2? We are going to upgrade from 1.6R5 So we want to get the latest possible release. Thanks ___ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tec

Re: "False" Scriptable Object

2009-03-04 Thread Norris Boyd
On Mar 4, 12:17 pm, Marc Guillemot wrote: > > ECMA is pretty clear that ToBoolean on an object is true. Why would > > you want to change this? > > I can't answer for Marcello but personally I want to be have the > possibility *not* to follow Ecma spec to mimic browser behavior. > Have a look at fo

Re: "False" Scriptable Object

2009-03-04 Thread Norris Boyd
On Mar 4, 4:00 pm, Marcello Bastéa-Forte wrote: > String is an object, right?  But a non-null String (i.e. length==0) can > evaluate as false... so it sounds like a contradiction. Actually, strings are primitive values and also can have a object form: js> function f(a) { print(typeof a); print(a

Re: Converting JS to Map

2009-03-04 Thread Marcello Bastéa-Forte
Can it be done as a "non-standard" extension to rhino? Marcello On Wed, Mar 4, 2009 at 6:25 AM, Attila Szegedi wrote: > Honestly, there should be advanced type coercion. We're sticking to the > LiveConnect "standard" for Java-JS interop, but my own opinion is that > LiveConnect is outdated and

Re: "False" Scriptable Object

2009-03-04 Thread Marcello Bastéa-Forte
String is an object, right? But a non-null String (i.e. length==0) can evaluate as false... so it sounds like a contradiction. Is there no way to make a custom class act like a String in the case of length==0? Feel free to tell me you think this is a bad idea and breaks convention too much. Mar

Help on Rhino

2009-03-04 Thread José Nicodemos
Help on Rhino Good day! I José Nicodemos da Cruz Júnior and I am doing a work Completion of course on the Rhino. But need some case studies on the subject. I wonder if someone could help me? Thank you for your attention. José Nicodemos da Cruz Júnior BS in Computer Science Awaiting response. _

Re: "False" Scriptable Object

2009-03-04 Thread Marc Guillemot
> ECMA is pretty clear that ToBoolean on an object is true. Why would > you want to change this? I can't answer for Marcello but personally I want to be have the possibility *not* to follow Ecma spec to mimic browser behavior. Have a look at following bug from October 2008: https://bugzilla.mozill

Re: Securing javascript

2009-03-04 Thread Attila Szegedi
I just committed a change to CVS HEAD where LazilyLoadedCtor objects that Rhino itself creates in initStandardObjects() will execute their buildValue() in an AccessController.doPrivileged() block. That way, lazy loading of standard lazy-constructed objects will work regardless of what are t

Re: Converting JS to Map

2009-03-04 Thread Attila Szegedi
Honestly, there should be advanced type coercion. We're sticking to the LiveConnect "standard" for Java-JS interop, but my own opinion is that LiveConnect is outdated and we should enhance it any way we see fit (starting with recognizing boolean as a first-class data type!). Automatically c

Re: Converting JS to Map

2009-03-04 Thread Patrick Lightbody
Ruland, OK - that's what I ended up doing last night. I was just hoping there would be some sort of more advanced type coercion system. No biggie - thanks! Patrick On Wed, Mar 4, 2009 at 4:12 AM, Ruland Kevin-BHP637 wrote: > Patrick, > > I'm typing this off the cuff, it might not be fully correc

Re: "False" Scriptable Object

2009-03-04 Thread Norris Boyd
On Mar 1, 12:44 am, Marcello Bastéa-Forte wrote: > Hey all, > > I want to make a custom Scriptable object "false" when evaluated in a > boolean context.  Just as an empty string evaluates as false, I would like > to make an object that evaluates to false depending on its contents. > > My first rea

Re: AST from function

2009-03-04 Thread Norris Boyd
On Feb 27, 8:19 am, Kris Zyp wrote: > On Oct 8 2008, 6:15 am, Kris Zyp wrote: > > > What is the best way to get the AST representation > > (org.mozilla.javascript.Node or appropriate subclass) of an existing > > function (one that was created by evaluation)? Currently I am calling > > JS toString

RE: Converting JS to Map

2009-03-04 Thread Ruland Kevin-BHP637
Patrick, I'm typing this off the cuff, it might not be fully correct. NativeObject.getIds() returns all the property names. This includes array indexes. This snippet of code should properly decode arrays (or array portions of objects) into the map. The keys to the array values are the string re

Re: Extending a Java class that has no default constructor

2009-03-04 Thread Joseph Montanez
My only question is why cant I extend java.awt.Color? I tried JMColor.prototpe.foo = function () { print('bar'); }; and JMColor.foo = function () { print('bar'); }; On Mar 4, 12:21 am, Joseph Montanez wrote: > I just spent an hour actraully trying to figure this out maybe I am > doing

Re: Extending a Java class that has no default constructor

2009-03-04 Thread Joseph Montanez
I just spent an hour actraully trying to figure this out maybe I am doing it wrong but it works. importPackage(java.awt); function JMColor(r,g,b) { // the same as calling super() var color = JavaAdapter(Color(r,g,b)); // Do your contstructor stuff here // return the object re