On Tue, Feb 16, 2010 at 11:14 AM, jg <[email protected]> wrote: > Hi all, > > sorry if this question is trivial... but I don't know how to deal with > this in js, and specifically in rhino shell... > > Say, I have an enum like > enum Cardsuit { CLUBS, DIAMONDS, SPADES, HEARTS } > > how do I use it in Rhino? > > Well, this is how I use them, which may not be what you want since it puts the values at the top level. Before running the script:
ScriptableObject.*putProperty*(scope, "CLUBS", Context.*javaToJS*(Cardsuit.* CLUBS*, scope)); -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:[email protected] _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
