I have spidermonkey setup to create objects from custom classes. For instance, in a script i can say...
var d0 = new MyDog();
...and on my app's C++ side a Dog object is created and stored.
What I would like to be able to do is then have that JSObject execute scripts in "it's own space". For example the dog object would execute a script that says...
this.Bark();
...and that dog object would call bark on itself.
With this functionality I could script objects independently.
I haven't found any info on this in the user guide documentation. I thought I could evaluate the script on the individual JSObject rather than the global object, but it doesn't seem to work.