On Jul 30, 2:35 am, Olivier Cornu <[email protected]> wrote:
...
> > But we also need to know that the compile was in a Sandbox so we can
> > create a SandboxSourceFile (which by the way is not defined yet ;-).
> > This would be returned from onTopLevelScriptCreated. You don't need
> > the sandbox itself, just a way to know that you need to get the source
> > from GM (well I assume you have a way to get the source...).
>
> As noted in my previous mail, the source code run in the Sandbox
> appears at some point in the Firebug trace (step #86):
> script.functionSource logged by onScriptCreated() on line 1514.
> It is not the script source in its exact original form though (it
> lacks some metadata/comments, etc), so it might still be a good idea
> to make this original source available from GM somehow.
jsdIScript.functionSource is the so-called pretty-print, but it is
correctly called the decompiled function. The line number will not
match the source in your editor.
>
> > With a SandboxSourceFile and the correct context, I guess the rest
> > will come together.
>
> I guess that, if we rely on GM to provide the Sandbox source, that
> would be a GMSandboxSourceFile (as opposed to a general Sandbox
> mechanism)?
Sure. I suppose the correct distinction would be by how the SourceFile
object differs from other SourceFile objects, but GMSandbox is fine.
>
> > You won't see any of the GM script's top level objects this way, I
> > suppose they are in the sandbox object. But you can't reach them from
> > the web page anyway. You will see stuff when you hit a breakpoint in a
> > GM script.
>
> That'd be excellent already. :-)
> Then i'd just like to add a way for users to poke around in a script
> Sandbox/scope from the Firebug console tab, which implies a mean for
> users to select said scope -- cd(scope)?
Strictly speaking you can't poke around in the scope of a function X
unless X is being compiled or run. I suppose you would allow users to
examine the properties of the Sandbox object. It would be more for
curiosity than practical us I think. The whole point (and failing) of
the sandbox is it be invisible.
jjb
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---