On Jul 26, 2:40 am, tradiate <[EMAIL PROTECTED]> wrote: > Imagine the following scenario: > C++ code invokes an XPCOM object (that happens to be written in > JavaScript) and then that JS object calls another XPCOM object that is > written in C++. Looks like this: > C++ -> XPCOM -> XPCwrappedJS -> JS -> XPCwrappedNative -> C++ > > Within the C++ object on the far right, I'd like to reach into the JS > environment of the JS that called it. Imagine calling > JS_GetProperty(). > > How would I go about digging up the scope object that the JS call came > from so I can use it in a call to JS_GetProperty() ?
why? that's a violation of the privacy model. Your c++ object can't legal reach into my C++ object.... The more proper way to do this is to just have your js object implement something like nsIProperties and then have the C++ object use that to ask for objects. You'll want to look around and see which is the best way to convert underlying js objects. I think I probably normally use jsdI interfaces to jump between them (although there are probably some tasty xpconnect ones available....). _______________________________________________ dev-tech-xpcom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xpcom
