There seems to be unneeded redundancy in onTopLevelScriptCreated().
It's declared like this in the firebug1.5 branch (as of Rev3858):
    onTopLevelScriptCreated: function(frame, outerScript, innerScripts)
But it seems frame.script===outerScript in all circumstances.

Why not make it simpler, like this:

--- a/components/firebug-service.js
+++ b/components/firebug-service.js
@@ -1442,7 +1442,7 @@ FirebugService.prototype =
             var debuggr = fbs.findDebugger(frame);  // sets
debuggr.breakContext

             if (debuggr)

             {

-                var sourceFile =
debuggr.onTopLevelScriptCreated(frame, frame.script,
fbs.nestedScriptStack.enumerate());

+                var sourceFile =
debuggr.onTopLevelScriptCreated(frame,
fbs.nestedScriptStack.enumerate());

                 if (FBTrace.DBG_FBS_SRCUNITS)
FBTrace.sysout("fbs.onTopLevelScriptCreated got
sourceFile:"+sourceFile+" using "+fbs.nestedScriptStack.length+"
nestedScripts\n");

                 fbs.resetBreakpoints(sourceFile,
frame.script.baseLineNumber+frame.script.lineExtent);

             }


--- a/content/firebug/debugger.js
+++ b/content/firebug/debugger.js
@@ -1085,15 +1085,15 @@ Firebug.Debugger = extend(Firebug.ActivableModule,
     },

     // We just compiled a bunch of JS, eg a script tag in HTML.  We
are about to run the outerScript.
-    onTopLevelScriptCreated: function(frame, outerScript, innerScripts)
+    onTopLevelScriptCreated: function(frame, innerScripts)
     {
+        var outerScript = frame.script;
         if (FBTrace.DBG_TOPLEVEL)
FBTrace.sysout("debugger("+this.debuggerName+").onTopLevelScriptCreated
script.fileName="+outerScript.fileName+"\n");
         var context = this.breakContext;
         delete this.breakContext;

         // This is our only chance to get the linetable for the
outerScript since it will run and be GC next.
-        var script = frame.script;
-        var url = normalizeURL(script.fileName);
+        var url = normalizeURL(outerScript.fileName);

         if (FBTrace.DBG_TOPLEVEL)
FBTrace.sysout("debugger.onTopLevelScriptCreated
outerScript.tag="+outerScript.tag+" has
fileName="+outerScript.fileName+"\n");

@@ -1107,7 +1107,7 @@ Firebug.Debugger = extend(Firebug.ActivableModule,
         }
         else
         {
-            sourceFile = new FBL.TopLevelSourceFile(url, script,
script.lineExtent, innerScripts);
+            sourceFile = new FBL.TopLevelSourceFile(url, outerScript,
outerScript.lineExtent, innerScripts);
             context.addSourceFile(sourceFile);
             if (FBTrace.DBG_SOURCEFILES)
FBTrace.sysout("debugger.onTopLevelScriptCreated create
sourcefile="+sourceFile.toString()+" -> "+context.getName()+"
("+context.uid+")"+"\n");
         }


-- 
Olivier

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to