Implement jsdICompilationUnit

John J Barton <[email protected]> Tue, 01 Dec 2009 15:29:58 -0800
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
For Firefox 3.7 I want to push to get an extension to jsd that would 
dramatically improve Firebug and improve Firefox's support for dynamic 
Javascript. I am looking for more feedback on the approach I am taking:

  Bug 449464 -  Implement jsdICompilationUnit to extend jsd to include 
information on the compilation unit structure.

https://bugzilla.mozilla.org/show_bug.cgi?id=449464

The bug has more justification and details. Broadly the API attempts to 
mimic the current jsdIDebuggerService style by adding a new callback 
hook, jsdICompilationHook and a new enumerate call, 
enumerateCompiledScripts().  This makes the API narrow but idiosyncratic 
(a good match to the current API ;-).

The implementation is "lightly salted": a few lines need to be added in 
a lot of places. Every place JS can be compiled needs a call to the hook 
and the hook-setting code needs to propagate up through the jsd layer 
cake to the JS interface. Algorithmically the jsengine builds a simple 
list of jsdIScripts threaded through JSDScript with the head in 
JSDContext. If the compilation hook is taken, the list can be copied out 
via enumerateCompiledScripts(), else it is not useful.

I would appreciate input. (I tried to set the followup here to 
mozilla.dev.apps.js-debugger, but I know that group is not widely 
followed so I've added platform and js-engine).

jjb