>>> Also, i suppose "this" should be the Sandbox in order to see things as >>> the debugged script does. >> >> I don't know whether or not the sandbox should be "this", since the >> whole sandbox model makes not sense to me. I never could figure out >> what it did which is why we took it out of Firebug.
As i've found out, "this" refers to the script scope. It usually is a Window but in case of a sandboxed script it's a Sandbox. It's fine like that. For the sake of completion: the empty "this" issue was because the Sandbox object has no hasOwnProperty(), __lookupGetter___() and __lookupSetter__() methods -- dom.js needs them to correctly print the object hierarchy. If i put dummy implementations of these methods everything works fine. :-) Also, very interestingly: "As of Firefox 3.5/Gecko 1.9.1, it's possible to optionally specify the JS version, filename, and line number of the code being evaluated" [1]. This means it seems possible for the Firebug-1.5 to support sandboxed scripts debugging (when they provide such information) without too many changes: they pretty much look like other top-level scripts. The only thing needed is a way for getFrameScopeWindowAncestor() to discover which window the script should be attached to (if any). The most generic test i've found (also working with GM) is the following: if the sandbox prototype is a Window (or a XPCNW of a Window) return it, otherwise the sandboxed script is ignored. It probably makes sense to debug sandboxed scripts which are as tied to a Window as that, although it's not a perfect test to filter relevant sandboxed scripts... -- Olivier [1] https://developer.mozilla.org/en/Components.utils.evalInSandbox --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/firebug?hl=en -~----------~----~----~----~------~----~------~--~---
