On May 18, 12:11 pm, Todd <tpatc...@gmail.com> wrote: > I am trying to pass an object that has a restrictive interface, so > that the JavaScript can only modify certain parameters on the java > class. What I am finding is that even though I am passing the object > as its interface, the script is treating it as the actual object. Is > there a way to pass it as the interface type?
I'm just getting started with Rhino and will be doing something similar. I _think_ that because JS has no concept of interfaces it will always see the object, not the interface. I _think_ you'll need facade objects (wrapping the target objects) that have only the methods you want to expose to JS and pass those calls on to the target objects. I have no idea if this is correct, so I'm waiting for someone else to chime in here :> I'll be going this direction unless I hear there is a better way! Chris _______________________________________________ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino