Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Check for timeline and profile capabilities before callin functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed May 19, 2014
1 parent 9549d4a commit 828e41b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/resources/javascript/modules/utils/profiling.js
Expand Up @@ -2,13 +2,13 @@ function wrap(name, fn) {
var wrapped = function() {
var result;

console.timeline(name);
console.profile(name);
console && console.timeline && console.timeline(name);
console && console.profile && console.profile(name);

result = fn.call(null);

console.timelineEnd();
console.profileEnd();
console && console.timelineEnd && console.timelineEnd();
console && console.profileEnd && console.profileEnd();

return result;
}
Expand Down

0 comments on commit 828e41b

Please sign in to comment.