Skip to content

Commit

Permalink
fix safeCall error handling in headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dfabulich committed Apr 19, 2012
1 parent edbb8e1 commit 29dc20c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

function safeCall(obj, fn) {
var debug = false || (typeof window != "undefined" && window.debug);
var isHeadless = typeof window == "undefined";
var debug = false || (!isHeadless && window.debug);
var userAgent = this.window && window.navigator && window.navigator.userAgent;
var isSafari = /Safari/.test(userAgent);
var isIE = /MSIE/.test(userAgent);
if (isIE) {
if (isIE || isHeadless) {
// just call through; onerror will be called and debugger will handle it
if (obj) {
fn.call(obj);
Expand Down

0 comments on commit 29dc20c

Please sign in to comment.