Skip to content

Commit

Permalink
Fixed two issues with the profiling: It wasn't working with different…
Browse files Browse the repository at this point in the history
… locales and an error was being thrown if the script panel wasn't enabled.
  • Loading branch information
jeresig committed Feb 24, 2009
1 parent f8cd28b commit 8d841b7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chrome/content/fireunit/fireunit.js
Expand Up @@ -385,10 +385,18 @@ FBL.ns(function() { with (FBL) {
var ret = { time: 0, calls: 0, data: [] };
var table = context.getPanel("console").panelNode
.getElementsByClassName("profileSizer");
table = table[table.length - 1].parentNode.parentNode;

if ( !table.length ) {
if ( win.console ) {
win.console.error("Firebug Script panel must be enabled in order for FireUnit profiling to work.");
}
return null;
}

table = table[table.length - 1].parentNode.parentNode;

var time = table.getElementsByClassName("profileTime")[0].textContent
.match(/([\d.]+)ms, (\d+) call/);
.match(/([\d.]+)\D+(\d+)/);

ret.time = parseFloat(time[1]);
ret.calls = parseFloat(time[2]);
Expand Down

0 comments on commit 8d841b7

Please sign in to comment.