Re: How to identify which script is being worked in
Harry Buttery <[email protected]> Fri, 28 Aug 2020 04:14:59 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
Hi, Thanks for your help, this has fixed my problem. Further to my original question however, I've now found that I require to know what script I'm currently working in when my WarningReporter function is called. I understand that the second argument of the WarningReporter is a JSErrorReport *, which has a 'filename' property. The Mozilla JSAPI Reference has this to say about the property: 'In the event of an error, filename will either contain the name of the external source file or URL containing the script (SCRIPT SRC=) or NULL, indicating that a script embedded in the current HTML page caused the error.' On the face of it, this appears to be able to solve the problem. However, in the context of our embedding (which only ever deals with scripts, not htmls), I was wondering if this property will always return a filename or, if it returned NULL, what that would mean/imply? Baring in mind, that we can have multiple scripts that may or may not share the same global object(s). If this property can't reliably help identify which script is being worked in, is there another way to identify the working script? Thanks again.