Re: How to identify which script is being worked in
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
I'm presume the context is from within a C++ method with a signature like |(JSContext* cx, unsigned argc, JS::Value* vp)| that you are triggering from JS. In that case you should be able follow a chain similar to CallArgs::calleev() -> JS_GetFunctionScript -> JS_GetScriptFilename. (Depending on your use case, you may want to consider targetting version 78. It will become the ESR version and security patches will continue to be generated for it, as well more embedders will target that version). On Thursday, August 13, 2020 at 6:10:55 AM UTC-4, [email protected] wrote: > Hi, > > I'm trying to update our current embedded Javascript engine from Spidermonkey 1.8.5 to 76. > > The issue that I'm currently facing is how to determine which script is being worked in when multiple scripts share the same global object. Previously, we would store some information in the context private data so as to identify the correct script. However, this is now proving unsuitable given that we can only have one context. > > I was just wondering if there is a straight forward way of determining which script is currently being worked in when a per-instance or per-class function has been called? > > Thanks > Harry