14 | var t={},a="__SEP_TAG__@[native]",r=function r(){this.error=o(),this.timestamp=new Date};function e(){return new Error("STACKTRACE TRACKING")}function n(){try{throw e()}catch(t){return t}}var c=e(),i=n(),o=c.stack?e:i.stack?n:e;function _(t){return t.stack?t.stack.split("\n"):[]}function s(a,r){for(var e=_(r),n=0;n<e.length;n++)t.hasOwnProperty(e[n])||a.push(e[n])}function f(t,r){var e=[r?r.trim():""];if(t)for(var n=(new Date).getTime(),c=0;c<t.length;c++){var i=t[c],o=i.timestamp,_="____________________Elapsed "+(n-o.getTime())+" ms; At: "+o;_=_.replace(/[^\w\d]/g,"_"),e.push(a.replace("__SEP_TAG__",_)),s(e,i.error),n=o.getTime()}return e.join("\n")}function u(){return Error.stackTraceLimit>0}Zone.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var a=t[Zone.__symbol__("currentTaskTrace")];return a?f(a,t.stack):t.stack}},onScheduleTask:function(t,a,e,n){if(u()){var c=Zone.currentTask,i=c&&c.data&&c.data.__creationTrace__||[];(i=[new r].concat(i)).length>this.longStackTraceLimit&&(i.length=this.longStackTraceLimit),n.data||(n.data={}),"eventTask"===n.type&&(n.data=Object.assign({},n.data)),n.data.__creationTrace__=i}return t.scheduleTask(e,n)},onHandleError:function(t,a,r,e){if(u()){var n=Zone.currentTask||e.task;if(e instanceof Error&&n){var c=f(n.data&&n.data.__creationTrace__,e.stack);try{e.stack=e.longStack=c}catch(t){}}}return t.handleError(r,e)}},function T(){if(u()){var e=[];!function t(a,e){e>0&&(a.push(_((new r).error)),t(a,e-1))}(e,2);for(var n=e[0],c=e[1],i=0;i<n.length;i++)if(-1==(s=n[i]).indexOf("STACKTRACE TRACKING")){var o=s.match(/^\s*at\s+/);if(o){a=o[0]+"__SEP_TAG__ (http://localhost)";break}}for(i=0;i<n.length;i++){var s;if((s=n[i])!==c[i])break;t[s]=!0}}}()})); |
---|