Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed two issues with the profiling: It wasn't working with different…

… locales and an error was being thrown if the script panel wasn't enabled.
  • Loading branch information...
commit 8d841b7bfaf1e942f3604273e86bf0ce7aa65a40 1 parent f8cd28b
@jeresig authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 chrome/content/fireunit/fireunit.js
View
12 chrome/content/fireunit/fireunit.js
@@ -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]);
Please sign in to comment.
Something went wrong with that request. Please try again.