Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make sure we have an error before merging user fields #5

Closed
wants to merge 1 commit into from

2 participants

Pieter de Bie Tim Morgan
Pieter de Bie

If an exception is captured from within the window.onerror handling (which can happen
if the code being run isn't wrapped in a try/catch block somehow), error will be
undefined in the TraceKit callback.

Pieter de Bie pieter Make sure we have an error before merging user fields
If an exception is captured from within the window.onerror handling (which can happen
if the code being run isn't wrapped in a try/catch block somehow), error will be
undefined in the TraceKit callback.
eb439f7
Tim Morgan
Owner

Merged with 4e78849

Tim Morgan RISCfuture closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. Pieter de Bie

    Make sure we have an error before merging user fields

    pieter authored
    If an exception is captured from within the window.onerror handling (which can happen
    if the code being run isn't wrapped in a try/catch block somehow), error will be
    undefined in the TraceKit callback.
This page is out of date. Refresh to see the latest.
48 vendor/assets/javascripts/squash_javascript.min.js
View
@@ -1,24 +1,24 @@
-(function(){var l,f={}.hasOwnProperty,i=[].slice,e="undefined"!==typeof exports&&null!==exports?exports:this,j=function(){},u;u=void 0;j.instance=function(){return null!=u?u:u=new l};e.SquashJavascript=j;var e=function(){TraceKit.report.subscribe(function(b,d){return SquashJavascript.instance().report(b,d)})},n,r,w,h;e.prototype.configure=function(b){var d,c,a;this.options||(this.options={disabled:!1,notifyPath:"/api/1.0/notify",transmitTimeout:15E3,ignoredExceptionClasses:[],ignoredExceptionMessages:{}});
-a=[];for(d in b)f.call(b,d)&&(c=b[d],a.push(this.options[d]=c));return a};e.prototype.notify=function(b,d){if(b instanceof Error)return b._squash_user_data=d,TraceKit.report(b);throw b;};e.prototype.report=function(b,d){var c,a,g,y,A,G,p,k,e,j,i,h;try{if(null!=(G=this.options)&&G.disabled)return!1;if(!(null!=(p=this.options)&&p.APIKey)||!(null!=(k=this.options)&&k.environment)||!(null!=(e=this.options)&&e.revision)||!(null!=(j=this.options)&&j.APIHost))return console.error("Missing required Squash configuration keys"),
-!1;if(this.shouldIgnoreError(b)||!b.stack)return!1;a={};a.api_key=this.options.APIKey;a.environment=this.options.environment;a.client="javascript";a.revision=this.options.revision;a.class_name=null!=(i=b.type)?i:b.name;!b.name&&(y=b.message.match(/^(Uncaught )?(\w+): (.+)/))?(a.class_name=y[2],a.message=y[3]):a.message=b.message;null==a.class_name&&(a.class_name="Error");a.backtraces=w(b.stack);a.capture_method=b.mode;a.occurred_at=n(new Date);a.schema=window.location.protocol.replace(/:$/,"");a.host=
-window.location.hostname;0<window.location.port.length&&(a.port=window.location.port);a.path=window.location.pathname;a.query=window.location.search;""!==window.location.hash&&(a.fragment=window.location.hash);a.user_agent=navigator.userAgent;a.screen_width=screen.width;a.screen_height=screen.height;a.window_width=window.innerWidth;a.window_height=window.innerHeight;a.color_depth=screen.colorDepth;h=d._squash_user_data;for(g in h)f.call(h,g)&&(A=h[g],a[g]=A);c=JSON.stringify(a);this.HTTPTransmit(this.options.APIHost+
-this.options.notifyPath,[["Content-Type","application/json"]],c);return!0}catch(r){return console.error("Error while trying to notify Squash:",r.stack),console.error("-- original error:",b)}};e.prototype.addUserData=function(b,d){try{return d()}catch(c){throw null==c._squash_user_data&&(c._squash_user_data={}),h(c._squash_user_data,b),c;}};e.prototype.addingUserData=function(b,d){return function(){var c;c=1<=arguments.length?i.call(arguments,0):[];return SquashJavascript.instance().addUserData(b,
-function(){return d.apply(null,c)})}};e.prototype.ignoreExceptions=function(){var b,d;d=2<=arguments.length?i.call(arguments,0,b=arguments.length-1):(b=0,[]);b=arguments[b++];try{return b()}catch(c){throw c._squash_ignored_exceptions=(c._squash_ignored_exceptions||[]).concat(d),c;}};e.prototype.ignoringExceptions=function(){var b,d,c;d=2<=arguments.length?i.call(arguments,0,c=arguments.length-1):(c=0,[]);b=arguments[c++];return function(){var a,g;a=1<=arguments.length?i.call(arguments,0):[];return(g=
-SquashJavascript.instance()).ignoreExceptions.apply(g,i.call(d).concat([function(){return b.apply(null,a)}]))}};e.prototype.HTTPTransmit=function(b,d,c){var a,g,y;a=new XMLHttpRequest;a.timeout=this.options.transmitTimeout;a.open("POST",b,!0);g=0;for(y=d.length;g<y;g++)b=d[g],a.setRequestHeader(b[0],b[1]);a.send(c);return a};e.prototype.shouldIgnoreError=function(b){var d;d=this.options.ignoredExceptionClasses.concat(b._squash_ignored_exceptions||[]);return r(d,function(c){return b.name===c})?!0:
-r(this.options.ignoredExceptionMessages,function(c,a){return b.name===c?r(a,function(a){return b.message.match(a)}):!1})};w=function(b){var d,c,a,g,y;d=[];g=0;for(y=b.length;g<y;g++)a=b[g],(c=a.context)&&r(c,function(a){return 200<a.length})&&(c=null),d.push({url:a.url,line:a.line,column:a.column,symbol:a.func,context:c,type:"minified"});return[{name:"Active Thread",faulted:!0,backtrace:d}]};n=function(b){var d;d=function(b){return 10>b?"0"+b:b};return""+b.getUTCFullYear()+"-"+d(b.getUTCMonth()+1)+
-"-"+d(b.getUTCDate())+"T"+d(b.getUTCHours())+":"+d(b.getUTCMinutes())+":"+d(b.getUTCSeconds())+"Z"};r=function(b,d){var c,a,g;if(b instanceof Array){a=0;for(g=b.length;a<g;a++)if(c=b[a],d(c))return!0}else for(c in b)if(f.call(b,c)&&(a=b[c],d(c,a)))return!0;return!1};h=function(b,d){var c,a,g;g=[];for(c in d)f.call(d,c)&&(a=d[c],g.push(b[c]=a));return g};l=e}).call(this);var TraceKit={};
-TraceKit.report=function(){function l(e,j){var f=null,h;for(h in i)if(i.hasOwnProperty(h))try{i[h](e,j)}catch(b){f=b}if(f)throw f;}function f(n){if(j){if(e===n)return;var i=j;e=j=null;l(i,n)}var f=TraceKit.computeStackTrace(n);j=f;e=n;window.setTimeout(function(){e===n&&(e=j=null,l(f,n))},f.incomplete?2E3:0);throw n;}var i=[],e=null,j=null,u=window.onerror;window.onerror=function(n,f,i){var h=null;j?(TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(j,f,i,n),h=j,e=j=null):(h={url:f,line:i},
-h.func=TraceKit.computeStackTrace.guessFunctionName(h.url,h.line),h.context=TraceKit.computeStackTrace.gatherContext(h.url,h.line),h={mode:"onerror",message:n,stack:[h]});l(h,null);return u?u.apply(this,arguments):!1};f.subscribe=function(e){i.push(e)};f.unsubscribe=function(e){for(var f=i.length-1;0<=f;--f)i[f]===e&&i.splice(f,1)};return f}();
-TraceKit.computeStackTrace=function(){function l(a){if(!c.hasOwnProperty(a)){var g,b=a.split("/");if(2<b.length&&b[2]===document.domain)try{void 0===XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(g){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(b){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(y){}throw Error("No XHR.");});var A=new XMLHttpRequest;A.open("GET",a,!1);
-A.send("");g=A.responseText}catch(d){g=""}else g=[];c[a]=g.length?g.split("\n"):[]}return c[a]}function f(a,g){var b=/function ([^(]*)\(([^)]*)\)/,A=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,d="",c=l(a),e;if(!c.length)return"?";for(var f=0;10>f;++f)if(d=c[g-f]+d,void 0!==d&&((e=A.exec(d))||(e=b.exec(d))))return e[1];return"?"}function i(a,g){var b=l(a),d=[],c=!1;if(!b.length)return null;for(var g=g-1,e=g-2,f=g+2;e<f;++e)d.push(b[e]),void 0!==b[e]&&(c=!0);return c?d:null}function e(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,
-"\\$&")}function j(a){return e(a).replace("<","(?:<|&lt;)").replace(">","(?:>|&gt;)").replace("&","(?:&|&amp;)").replace('"','(?:"|&quot;)').replace(/\s+/g,"\\s+")}function u(a,b){for(var d,c,e=0,f=b.length;e<f;++e)if((d=l(b[e])).length)if(d=d.join("\n"),c=a.exec(d))return{url:b[e],line:d.substring(0,c.index).split("\n").length,column:c.index-d.lastIndexOf("\n",c.index)-1};return null}function n(a,b,d){var b=l(b),a=RegExp("\\b"+e(a)+"\\b"),c,d=d-1;return b&&b.length>d&&(c=a.exec(b[d]))?c.index:null}
-function r(a){var b=[window.location.href],d=document.getElementsByTagName("script"),a=""+a,c;for(c=0;c<d.length;++c){var f=d[c];f.src&&b.push(f.src)}(d=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(a))?(c=d[1]?"\\s+"+d[1]:"",f=d[2].split(",").join("\\s*,\\s*"),d=e(d[3]).replace(/;$/,";?").replace(/\s+/g,"\\s+"),c=RegExp("function"+c+"\\s*\\(\\s*"+f+"\\s*\\)\\s*{\\s*"+d+"\\s*}")):c=RegExp(e(a).replace(/\s+/g,"\\s+"));if(c=u(c,b))return c;if(d=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(a)){a=
-d[1];d=j(d[2]);c=RegExp("on"+a+"=[\\'\"]\\s*"+d+"\\s*[\\'\"]","i");if(c=u(c,b[0]))return c;c=RegExp(d);if(c=u(c,b))return c}return null}function w(a,b,d,c){b={url:b,line:d};if(b.url&&b.line){a.incomplete=!1;b.func||(b.func=f(b.url,b.line));b.context||(b.context=i(b.url,b.line));if(c=/ '([^']+)' /.exec(c))b.column=n(c[1],b.url,b.line);if(0<a.stack.length&&a.stack[0].url===b.url){if(a.stack[0].line===b.line)return!1;if(!a.stack[0].line&&a.stack[0].func===b.func)return a.stack[0].line=b.line,a.stack[0].context=
-b.context,!1}a.stack.unshift(b);return a.partial=!0}a.incomplete=!0;return!1}function h(a,d){for(var c=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,e=[],i={},j,k,h=arguments.callee.caller;h;h=h.caller)if(!(h===b||h===TraceKit.report)){k={url:null,func:"?",line:null,column:null};if(h.name)k.func=h.name;else if(j=c.exec(h.toString()))k.func=j[1];if(j=r(h)){k.url=j.url;k.line=j.line;"?"===k.func&&(k.func=f(k.url,k.line));var l=/ '([^']+)' /.exec(a.message||a.description);l&&(k.column=
-n(l[1],j.url,j.line))}i[""+h]&&(k.recursion=!0);e.push(k)}d&&e.splice(0,d);c={mode:"callers",name:a.name,message:a.message,stack:e};w(c,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description);return c}function b(a,b){var c=null,b=void 0===b?0:+b;try{for(var e=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,r=a.stacktrace.split("\n"),p=[],k,w=0,L=r.length;w<L;w+=2)if(k=e.exec(r[w])){var v={line:+k[1],column:+k[2],func:k[3]||k[4],args:k[5]?
-k[5].split(","):[],url:k[6]};!v.func&&v.line&&(v.func=f(v.url,v.line));if(v.line)try{v.context=i(v.url,v.line)}catch(U){}v.context||(v.context=[r[w+1]]);p.push(v)}c=p.length?{mode:"stacktrace",name:a.name,message:a.message,stack:p}:null;if(c)return c}catch(M){if(d)throw M;}try{if(a.stack){var e=/^\s*at (\S+) \(((?:file|http):.*?):(\d+)(?::(\d+))?\)\s*$/i,r=/^\s*(\S*)(?:\((.*?)\))?@((?:file|http).*?):(\d+)(?::(\d+))?\s*$/i,D=a.stack.split("\n"),p=[],q,s,C=/^(.*) is undefined$/.exec(a.message);k=0;
-for(var F=D.length;k<F;++k){if(q=r.exec(D[k]))s={url:q[3],func:q[1],args:q[2]?q[2].split(","):"",line:+q[4],column:q[5]?+q[5]:null};else if(q=e.exec(D[k]))s={url:q[2],func:q[1],line:+q[3],column:q[4]?+q[4]:null};else continue;!s.func&&s.line&&(s.func=f(s.url,s.line));s.line&&(s.context=i(s.url,s.line));p.push(s)}p[0]&&(p[0].line&&!p[0].column&&C)&&(p[0].column=n(C[1],p[0].url,p[0].line));c=p.length?{mode:"stack",name:a.name,message:a.message,stack:p}:null}else c=null;if(c)return c}catch(N){if(d)throw N;
-}try{var z=a.message.split("\n");if(4>z.length)c=null;else{D=/^\s*Line (\d+) of linked script ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;q=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;s=/^\s*Line (\d+) of function script\s*$/i;var C=[],m=document.getElementsByTagName("script"),F=[],x,t,H,B;for(t in m)m.hasOwnProperty(t)&&!m[t].src&&F.push(m[t]);t=2;for(H=z.length;t<H;t+=2){m=null;if(x=D.exec(z[t]))m={url:x[2],func:x[3],line:+x[1]};else if(x=q.exec(z[t])){var m=
-{url:x[3],func:x[4]},O=+x[1],I=F[x[2]-1];if(I&&(B=l(m.url))){B=B.join("\n");var J=B.indexOf(I.innerText);0<=J&&(m.line=O+B.substring(0,J).split("\n").length)}}else if(x=s.exec(z[t])){var K=window.location.href.replace(/#.*$/,""),P=x[1],Q=RegExp(j(z[t+1]));B=u(Q,[K]);m={url:K,line:B?B.line:P,func:""}}if(m){m.func||(m.func=f(m.url,m.line));var E=i(m.url,m.line),R=E?E[Math.floor(E.length/2)]:null;m.context=E&&R.replace(/^\s*/,"")===z[t+1].replace(/^\s*/,"")?E:[z[t+1]];C.push(m)}}c=C.length?{mode:"multiline",
-name:a.name,message:z[0],stack:C}:null}if(c)return c}catch(S){if(d)throw S;}try{if(c=h(a,b+1))return c}catch(T){if(d)throw T;}return{mode:"failed"}}var d=!1,c={};b.augmentStackTraceWithInitialElement=w;b.guessFunctionName=f;b.gatherContext=i;b.ofCaller=function(a){a=(void 0===a?0:+a)+1;try{0()}catch(c){return b(c,a+1)}return null};return b}();
-(function(l){var f=Array.prototype.slice,i=l.setTimeout;l.setTimeout=function(){var e=f.call(arguments,0),l=e[0];e[0]=function(){try{l.apply(this,arguments)}catch(e){throw TraceKit.report(e),e;}};return i.apply(this,e)};var e=l.setInterval;l.setInterval=function(){var j=f.call(arguments,0),i=j[0];j[0]=function(){try{i.apply(this,arguments)}catch(e){throw TraceKit.report(e),e;}};return e.apply(this,j)}})(window);
+(function(){var m,q={}.hasOwnProperty,g=[].slice;("undefined"!==typeof exports&&null!==exports?exports:this).SquashJavascript=function(){function d(){}var f;f=void 0;d.instance=function(){return null!=f?f:f=new m};return d}();m=function(){function d(){TraceKit.report.subscribe(function(b,c){return SquashJavascript.instance().report(b,c)})}var f,s,l,A;d.prototype.configure=function(b){var c,e,a;this.options||(this.options={disabled:!1,notifyPath:"/api/1.0/notify",transmitTimeout:15E3,ignoredExceptionClasses:[],
+ignoredExceptionMessages:{}});a=[];for(c in b)q.call(b,c)&&(e=b[c],a.push(this.options[c]=e));return a};d.prototype.notify=function(b,c){if(b instanceof Error)return b._squash_user_data=c,TraceKit.report(b);throw b;};d.prototype.report=function(b,c){var e,a,x,d,G,H,I,J,K,k,h,n;try{if(null!=(H=this.options)&&H.disabled)return!1;if(!(null!=(I=this.options)&&I.APIKey)||!(null!=(J=this.options)&&J.environment)||!(null!=(K=this.options)&&K.revision)||!(null!=(k=this.options)&&k.APIHost))return console.error("Missing required Squash configuration keys"),
+!1;if(this.shouldIgnoreError(b)||!b.stack)return!1;a={};a.api_key=this.options.APIKey;a.environment=this.options.environment;a.client="javascript";a.revision=this.options.revision;a.class_name=null!=(h=b.type)?h:b.name;!b.name&&(d=b.message.match(/^(Uncaught )?(\w+): (.+)/))?(a.class_name=d[2],a.message=d[3]):a.message=b.message;null==a.class_name&&(a.class_name="Error");a.backtraces=l(b.stack);a.capture_method=b.mode;a.occurred_at=f(new Date);a.schema=window.location.protocol.replace(/:$/,"");a.host=
+window.location.hostname;0<window.location.port.length&&(a.port=window.location.port);a.path=window.location.pathname;a.query=window.location.search;""!==window.location.hash&&(a.fragment=window.location.hash);a.user_agent=navigator.userAgent;a.screen_width=screen.width;a.screen_height=screen.height;a.window_width=window.innerWidth;a.window_height=window.innerHeight;a.color_depth=screen.colorDepth;if(c)for(x in n=c._squash_user_data,n)q.call(n,x)&&(G=n[x],a[x]=G);e=JSON.stringify(a);this.HTTPTransmit(this.options.APIHost+
+this.options.notifyPath,[["Content-Type","application/json"]],e);return!0}catch(g){return console.error("Error while trying to notify Squash:",g.stack),console.error("-- original error:",b)}};d.prototype.addUserData=function(b,c){try{return c()}catch(e){throw null==e._squash_user_data&&(e._squash_user_data={}),A(e._squash_user_data,b),e;}};d.prototype.addingUserData=function(b,c){return function(){var e;e=1<=arguments.length?g.call(arguments,0):[];return SquashJavascript.instance().addUserData(b,
+function(){return c.apply(null,e)})}};d.prototype.ignoreExceptions=function(){var b,c;c=2<=arguments.length?g.call(arguments,0,b=arguments.length-1):(b=0,[]);b=arguments[b++];try{return b()}catch(e){throw e._squash_ignored_exceptions=(e._squash_ignored_exceptions||[]).concat(c),e;}};d.prototype.ignoringExceptions=function(){var b,c,e;c=2<=arguments.length?g.call(arguments,0,e=arguments.length-1):(e=0,[]);b=arguments[e++];return function(){var a,e;a=1<=arguments.length?g.call(arguments,0):[];return(e=
+SquashJavascript.instance()).ignoreExceptions.apply(e,g.call(c).concat([function(){return b.apply(null,a)}]))}};d.prototype.HTTPTransmit=function(b,c,e){var a,d,f;a=new XMLHttpRequest;a.timeout=this.options.transmitTimeout;a.open("POST",b,!0);d=0;for(f=c.length;d<f;d++)b=c[d],a.setRequestHeader(b[0],b[1]);a.send(e);return a};d.prototype.shouldIgnoreError=function(b){var c;c=this.options.ignoredExceptionClasses.concat(b._squash_ignored_exceptions||[]);return s(c,function(c){return b.name===c})?!0:
+s(this.options.ignoredExceptionMessages,function(c,a){return b.name===c?s(a,function(a){return b.message.match(a)}):!1})};l=function(b){var c,e,a,d,f;c=[];d=0;for(f=b.length;d<f;d++)a=b[d],(e=a.context)&&s(e,function(b){return 200<b.length})&&(e=null),c.push({url:a.url,line:a.line,column:a.column,symbol:a.func,context:e,type:"minified"});return[{name:"Active Thread",faulted:!0,backtrace:c}]};f=function(b){var c;c=function(b){return 10>b?"0"+b:b};return""+b.getUTCFullYear()+"-"+c(b.getUTCMonth()+1)+
+"-"+c(b.getUTCDate())+"T"+c(b.getUTCHours())+":"+c(b.getUTCMinutes())+":"+c(b.getUTCSeconds())+"Z"};s=function(b,c){var e,a,d;if(b instanceof Array){a=0;for(d=b.length;a<d;a++)if(e=b[a],c(e))return!0}else for(e in b)if(q.call(b,e)&&(a=b[e],c(e,a)))return!0;return!1};A=function(b,c){var e,a,d;d=[];for(e in c)q.call(c,e)&&(a=c[e],d.push(b[e]=a));return d};return d}()}).call(this);var TraceKit={};
+TraceKit.report=function(){function m(d,f){var b=null,c;for(c in g)if(g.hasOwnProperty(c))try{g[c](d,f)}catch(e){b=e}if(b)throw b;}function q(l){if(f){if(d===l)return;var g=f;d=f=null;m(g,l)}var b=TraceKit.computeStackTrace(l);f=b;d=l;window.setTimeout(function(){d===l&&(d=f=null,m(b,l))},b.incomplete?2E3:0);throw l;}var g=[],d=null,f=null,s=window.onerror;window.onerror=function(l,g,b){var c=null;f?(TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(f,g,b,l),c=f,d=f=null):(c={url:g,line:b},
+c.func=TraceKit.computeStackTrace.guessFunctionName(c.url,c.line),c.context=TraceKit.computeStackTrace.gatherContext(c.url,c.line),c={mode:"onerror",message:l,stack:[c]});m(c,null);return s?s.apply(this,arguments):!1};q.subscribe=function(d){g.push(d)};q.unsubscribe=function(d){for(var f=g.length-1;0<=f;--f)g[f]===d&&g.splice(f,1)};return q}();
+TraceKit.computeStackTrace=function(){function m(b){try{void 0===XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(G){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}throw Error("No XHR.");});var a=new XMLHttpRequest;a.open("GET",b,!1);a.send("");return a.responseText}catch(c){return""}}function q(b){if(!C.hasOwnProperty(b)){var a;
+a=b.split("/");a=2<a.length&&a[2]===document.domain?m(b):[];C[b]=a.length?a.split("\n"):[]}return C[b]}function g(b,a){var c=/function ([^(]*)\(([^)]*)\)/,d=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,e="",f=q(b),h;if(!f.length)return"?";for(var g=0;10>g;++g)if(e=f[a-g]+e,void 0!==e&&((h=d.exec(e))||(h=c.exec(e))))return h[1];return"?"}function d(b,a){var c=q(b),d=[],e=!1;if(!c.length)return null;a-=1;for(var f=a-2,h=a+2;f<h;++f)d.push(c[f]),void 0!==c[f]&&(e=!0);return e?d:
+null}function f(b){return b.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function s(b){return f(b).replace("<","(?:<|&lt;)").replace(">","(?:>|&gt;)").replace("&","(?:&|&amp;)").replace('"','(?:"|&quot;)').replace(/\s+/g,"\\s+")}function l(b,a){for(var c,d,e=0,f=a.length;e<f;++e)if((c=q(a[e])).length)if(c=c.join("\n"),d=b.exec(c))return{url:a[e],line:c.substring(0,d.index).split("\n").length,column:d.index-c.lastIndexOf("\n",d.index)-1};return null}function A(b,a,c){a=q(a);b=RegExp("\\b"+f(b)+"\\b");
+var d;c-=1;return a&&a.length>c&&(d=b.exec(a[c]))?d.index:null}function b(b){var a=[window.location.href],c=document.getElementsByTagName("script");b=""+b;var d;for(d=0;d<c.length;++d){var e=c[d];e.src&&a.push(e.src)}(c=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(b))?(d=c[1]?"\\s+"+c[1]:"",e=c[2].split(",").join("\\s*,\\s*"),c=f(c[3]).replace(/;$/,";?").replace(/\s+/g,"\\s+"),d=RegExp("function"+d+"\\s*\\(\\s*"+e+"\\s*\\)\\s*{\\s*"+c+"\\s*}")):d=RegExp(f(b).replace(/\s+/g,
+"\\s+"));if(d=l(d,a))return d;if(c=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(b)){b=c[1];c=s(c[2]);d=RegExp("on"+b+"=[\\'\"]\\s*"+c+"\\s*[\\'\"]","i");if(d=l(d,a[0]))return d;d=RegExp(c);if(d=l(d,a))return d}return null}function c(b,a,c,e){a={url:a,line:c};if(a.url&&a.line){b.incomplete=!1;a.func||(a.func=g(a.url,a.line));a.context||(a.context=d(a.url,a.line));if(e=/ '([^']+)' /.exec(e))a.column=A(e[1],a.url,a.line);if(0<b.stack.length&&b.stack[0].url===a.url){if(b.stack[0].line===
+a.line)return!1;if(!b.stack[0].line&&b.stack[0].func===a.func)return b.stack[0].line=a.line,b.stack[0].context=a.context,!1}b.stack.unshift(a);return b.partial=!0}b.incomplete=!0;return!1}function e(d,e){for(var f=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,l=[],q={},k,h,n=arguments.callee.caller;n;n=n.caller)if(!(n===a||n===TraceKit.report)){h={url:null,func:"?",line:null,column:null};if(n.name)h.func=n.name;else if(k=f.exec(n.toString()))h.func=k[1];if(k=b(n)){h.url=k.url;
+h.line=k.line;"?"===h.func&&(h.func=g(h.url,h.line));var s=/ '([^']+)' /.exec(d.message||d.description);s&&(h.column=A(s[1],k.url,k.line))}q[""+n]&&(h.recursion=!0);l.push(h)}e&&l.splice(0,e);f={mode:"callers",name:d.name,message:d.message,stack:l};c(f,d.sourceURL||d.fileName,d.line||d.lineNumber,d.message||d.description);return f}function a(a,b){var c=null;b=void 0===b?0:+b;try{for(var f=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,m=a.stacktrace.split("\n"),
+k=[],h,n=0,C=m.length;n<C;n+=2)if(h=f.exec(m[n])){var v={line:+h[1],column:+h[2],func:h[3]||h[4],args:h[5]?h[5].split(","):[],url:h[6]};!v.func&&v.line&&(v.func=g(v.url,v.line));if(v.line)try{v.context=d(v.url,v.line)}catch(X){}v.context||(v.context=[m[n+1]]);k.push(v)}c=k.length?{mode:"stacktrace",name:a.name,message:a.message,stack:k}:null;if(c)return c}catch(P){if(x)throw P;}try{if(a.stack){var f=/^\s*at (\S+) \(((?:file|http):.*?):(\d+)(?::(\d+))?\)\s*$/i,m=/^\s*(\S*)(?:\((.*?)\))?@((?:file|http).*?):(\d+)(?::(\d+))?\s*$/i,
+D=a.stack.split("\n"),k=[],r,t,B=/^(.*) is undefined$/.exec(a.message);h=0;for(var F=D.length;h<F;++h){if(r=m.exec(D[h]))t={url:r[3],func:r[1],args:r[2]?r[2].split(","):"",line:+r[4],column:r[5]?+r[5]:null};else if(r=f.exec(D[h]))t={url:r[2],func:r[1],line:+r[3],column:r[4]?+r[4]:null};else continue;!t.func&&t.line&&(t.func=g(t.url,t.line));t.line&&(t.context=d(t.url,t.line));k.push(t)}k[0]&&(k[0].line&&!k[0].column&&B)&&(k[0].column=A(B[1],k[0].url,k[0].line));c=k.length?{mode:"stack",name:a.name,
+message:a.message,stack:k}:null}else c=null;if(c)return c}catch(Q){if(x)throw Q;}try{var y=a.message.split("\n");if(4>y.length)c=null;else{D=/^\s*Line (\d+) of linked script ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;r=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;t=/^\s*Line (\d+) of function script\s*$/i;var B=[],p=document.getElementsByTagName("script"),F=[],w,u,L,z;for(u in p)p.hasOwnProperty(u)&&!p[u].src&&F.push(p[u]);u=2;for(L=y.length;u<L;u+=
+2){p=null;if(w=D.exec(y[u]))p={url:w[2],func:w[3],line:+w[1]};else if(w=r.exec(y[u])){var p={url:w[3],func:w[4]},R=+w[1],M=F[w[2]-1];if(M&&(z=q(p.url))){z=z.join("\n");var N=z.indexOf(M.innerText);0<=N&&(p.line=R+z.substring(0,N).split("\n").length)}}else if(w=t.exec(y[u])){var O=window.location.href.replace(/#.*$/,""),S=w[1],T=RegExp(s(y[u+1]));z=l(T,[O]);p={url:O,line:z?z.line:S,func:""}}if(p){p.func||(p.func=g(p.url,p.line));var E=d(p.url,p.line),U=E?E[Math.floor(E.length/2)]:null;E&&U.replace(/^\s*/,
+"")===y[u+1].replace(/^\s*/,"")?p.context=E:p.context=[y[u+1]];B.push(p)}}c=B.length?{mode:"multiline",name:a.name,message:y[0],stack:B}:null}if(c)return c}catch(V){if(x)throw V;}try{if(c=e(a,b+1))return c}catch(W){if(x)throw W;}return{mode:"failed"}}var x=!1,C={};a.augmentStackTraceWithInitialElement=c;a.guessFunctionName=g;a.gatherContext=d;a.ofCaller=function(b){b=(void 0===b?0:+b)+1;try{0()}catch(c){return a(c,b+1)}return null};return a}();
+(function(m){var q=Array.prototype.slice,g=m.setTimeout;m.setTimeout=function(){var d=q.call(arguments,0),m=d[0];d[0]=function(){try{m.apply(this,arguments)}catch(d){throw TraceKit.report(d),d;}};return g.apply(this,d)};var d=m.setInterval;m.setInterval=function(){var f=q.call(arguments,0),g=f[0];f[0]=function(){try{g.apply(this,arguments)}catch(d){throw TraceKit.report(d),d;}};return d.apply(this,f)}})(window);
12 vendor/assets/javascripts/squash_javascript.orig.js
View
@@ -107,11 +107,13 @@
fields.window_width = window.innerWidth;
fields.window_height = window.innerHeight;
fields.color_depth = screen.colorDepth;
- _ref7 = error._squash_user_data;
- for (k in _ref7) {
- if (!__hasProp.call(_ref7, k)) continue;
- v = _ref7[k];
- fields[k] = v;
+ if (error) {
+ _ref7 = error._squash_user_data;
+ for (k in _ref7) {
+ if (!__hasProp.call(_ref7, k)) continue;
+ v = _ref7[k];
+ fields[k] = v;
+ }
}
body = JSON.stringify(fields);
this.HTTPTransmit(this.options.APIHost + this.options.notifyPath, [['Content-Type', 'application/json']], body);
3  vendor/assets/javascripts/squash_javascript/client.coffee
View
@@ -112,7 +112,8 @@ class _SquashJavascript
fields.window_height = window.innerHeight
fields.color_depth = screen.colorDepth
- (fields[k] = v for own k, v of error._squash_user_data)
+ if error
+ (fields[k] = v for own k, v of error._squash_user_data)
body = JSON.stringify(fields)
this.HTTPTransmit (@options.APIHost + @options.notifyPath),
Something went wrong with that request. Please try again.