Comparing version 0.7.1 to 0.7.2
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* Zone is a mechanism for intercepting and keeping track of asynchronous work. | ||
@@ -462,2 +469,15 @@ * | ||
} | ||
/** | ||
* Extend the Error with additional fields for rewritten stack frames | ||
*/ | ||
interface Error { | ||
/** | ||
* Stack trace where extra frames have been removed and zone names added. | ||
*/ | ||
zoneAwareStack?: string; | ||
/** | ||
* Original stack trace with no modiffications | ||
*/ | ||
originalStack?: string; | ||
} | ||
declare const Zone: ZoneType; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){return function(){return t.apply(this,e(arguments,r+"."+a))}}(i))},a=0;a<n.length;a++)o(a)}function n(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||{enumerable:!0,configurable:!0};delete n.writable,delete n.value;var r=t.substr(2),o="_"+t;n.set=function(e){if(this[o]&&this.removeEventListener(r,this[o]),"function"==typeof e){var t=function(t){var n;n=e.apply(this,arguments),void 0==n||n||t.preventDefault()};this[o]=t,this.addEventListener(r,t,!1)}else this[o]=null},n.get=function(){return this[o]||null},Object.defineProperty(e,t,n)}function r(e,t){var r=[];for(var o in e)"on"==o.substr(0,2)&&r.push(o);for(var a=0;a<r.length;a++)n(e,r[a]);if(t)for(var i=0;i<t.length;i++)n(e,"on"+t[i])}function o(e,t,n,r,o){var a=e[P];if(a)for(var i=0;i<a.length;i++){var u=a[i],c=u.data,l=c.handler;if((c.handler===t||l.listener===t)&&c.useCapturing===r&&c.eventName===n)return o&&a.splice(i,1),u}return null}function a(e,t,n){var r=e[P];r||(r=e[P]=[]),n?r.unshift(t):r.push(t)}function i(e,t,n,r,i){function u(e){var t=e.data;return a(t.target,e,i),t.target[l](t.eventName,e.invoke,t.useCapturing)}function c(e){var t=e.data;o(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.target[p](t.eventName,e.invoke,t.useCapturing)}void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===i&&(i=!1);var l=T(e),p=T(t),s=!n&&void 0;return function(t,n){var a=n[0],i=n[1],p=n[2]||s,f=t||L,d=null;"function"==typeof i?d=i:i&&i.handleEvent&&(d=function(e){return i.handleEvent(e)});var v=!1;try{v=i&&"[object FunctionWrapper]"===i.toString()}catch(g){return}if(!d||v)return f[l](a,i,p);if(!r){var y=o(f,i,a,p,!1);if(y)return f[l](a,y.invoke,p)}var b=Zone.current,h=f.constructor.name+"."+e+":"+a,m={target:f,eventName:a,name:a,useCapturing:p,handler:i};b.scheduleEventTask(h,d,m,u,c)}}function u(e,t){void 0===t&&(t=!0);var n=T(e),r=!t&&void 0;return function(e,t){var a=t[0],i=t[1],u=t[2]||r,c=e||L,l=o(c,i,a,u,!0);l?l.zone.cancelTask(l):c[n](a,i,u)}}function c(e){return!(!e||!e.addEventListener)&&(s(e,C,function(){return R}),s(e,S,function(){return q}),!0)}function l(t){var n=L[t];if(n){L[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[B]=new n;break;case 1:this[B]=new n(r[0]);break;case 2:this[B]=new n(r[0],r[1]);break;case 3:this[B]=new n(r[0],r[1],r[2]);break;case 4:this[B]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}};var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?L[t].prototype[e]=function(){return this[B][e].apply(this[B],arguments)}:Object.defineProperty(L[t].prototype,e,{set:function(n){"function"==typeof n?this[B][e]=Zone.current.wrap(n,t+"."+e):this[B][e]=n},get:function(){return this[B][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(L[t][r]=n[r])}}function p(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(n){return function(){return t(this,arguments)}}}function s(e,t,n){for(var r=e;r&&Object.getOwnPropertyNames(r).indexOf(t)===-1;)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=T(t);return r&&!(o=r[a])&&(o=r[a]=r[t],r[t]=p(t,n(o,a,t))),o}function f(e,t,n,r){function o(t){var n=t.data;return n.args[0]=function(){t.invoke.apply(this,arguments),delete c[n.handleId]},n.handleId=i.apply(e,n.args),c[n.handleId]=t,t}function a(e){return delete c[e.data.handleId],u(e.data.handleId)}var i=null,u=null;t+=r,n+=r;var c={};i=s(e,t,function(n){return function(i,u){if("function"==typeof u[0]){var c=Zone.current,l={handleId:null,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?u[1]||0:null,args:u},p=c.scheduleMacroTask(t,u[0],l,o,a);if(!p)return p;var s=p.data.handleId;return s.ref&&s.unref&&(p.ref=s.ref.bind(s),p.unref=s.unref.bind(s)),p}return n.apply(e,u)}}),u=s(e,n,function(t){return function(n,r){var o="number"==typeof r[0]?c[r[0]]:r[0];o&&"string"==typeof o.type?(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}function d(){Object.defineProperty=function(e,t,n){if(g(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=y(e,t,n)),b(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=y(e,n,t[n])}),x(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=F(e,t);return g(e,t)&&(n.configurable=!1),n}}function v(e,t,n){var r=n.configurable;return n=y(e,t,n),b(e,t,n,r)}function g(e,t){return e&&e[W]&&e[W][t]}function y(e,t,n){return n.configurable=!0,n.configurable||(e[W]||H(e,W,{writable:!0,value:{}}),e[W][t]=!0),n}function b(e,t,n,r){try{return H(e,t,n)}catch(o){if(!n.configurable)throw o;"undefined"==typeof r?delete n.configurable:n.configurable=r;try{return H(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=a.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function h(e){var t=[],n=e.wtf;n?t=X.split(",").map(function(e){return"HTML"+e+"Element"}).concat(Z):e[z]?t.push(z):t=Z;for(var r=0;r<t.length;r++){var o=e[t[r]];c(o&&o.prototype)}}function m(e){var t=e.WebSocket;e.EventTarget||c(t.prototype),e.WebSocket=function(e,n){var o,a=arguments.length>1?new t(e,n):new t(e),i=Object.getOwnPropertyDescriptor(a,"onmessage");return i&&i.configurable===!1?(o=Object.create(a),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return a[e].apply(a,arguments)}})):o=a,r(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}function w(e){if(!D){var t="undefined"!=typeof WebSocket;k()?(M&&r(HTMLElement.prototype,A),r(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,null),r(IDBRequest.prototype,null),r(IDBOpenDBRequest.prototype,null),r(IDBDatabase.prototype,null),r(IDBTransaction.prototype,null),r(IDBCursor.prototype,null)),t&&r(WebSocket.prototype,null)):(O(),l("XMLHttpRequest"),t&&m(e))}}function k(){if(M&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{get:function(){return!0}});var t=new XMLHttpRequest,n=!!t.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{}),n}function O(){for(var e=function(e){var t=A[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][N]&&(t=Zone.current.wrap(o[n],r),t[N]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<A.length;t++)e(t)}function E(e){if(M&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),v(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])}}}function j(e){function t(e){var t=e[Q];return t}function n(e){var t=e.data;t.target.addEventListener("readystatechange",function(){t.target.readyState===t.target.DONE&&(t.aborted||e.invoke())});var n=t.target[Q];return n||(t.target[Q]=e),i.apply(t.target,t.args),e}function r(){}function o(e){var t=e.data;return t.aborted=!0,u.apply(t.target,t.args)}var a=s(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[Y]=0==t[2],a.apply(e,t)}}),i=s(e.XMLHttpRequest.prototype,"send",function(){return function(e,t){var a=Zone.current;if(e[Y])return i.apply(e,t);var u={target:e,isPeriodic:!1,delay:null,args:t,aborted:!1};return a.scheduleMacroTask("XMLHttpRequest.send",r,u,n,o)}}),u=s(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,n){var r=t(e);if(r&&"string"==typeof r.type){if(null==r.cancelFn)return;r.zone.cancelTask(r)}}})}var T=Zone.__symbol__,L="object"==typeof window&&window||"object"==typeof self&&self||global,I="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,D="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),M=!D&&!I&&!("undefined"==typeof window||!window.HTMLElement),P=T("eventTasks"),C="addEventListener",S="removeEventListener",R=i(C,S),q=u(S),B=T("originalInstance"),H=Object[T("defineProperty")]=Object.defineProperty,F=Object[T("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,x=Object.create,W=T("unconfigurables"),X="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",Z="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),z="EventTarget",A="copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror".split(" "),N=T("unbound"),_="set",G="clear",K=["alert","prompt","confirm"],U="object"==typeof window&&window||"object"==typeof self&&self||global;f(U,_,G,"Timeout"),f(U,_,G,"Interval"),f(U,_,G,"Immediate"),f(U,"request","cancel","AnimationFrame"),f(U,"mozRequest","mozCancel","AnimationFrame"),f(U,"webkitRequest","webkitCancel","AnimationFrame");for(var V=0;V<K.length;V++){var J=K[V];s(U,J,function(e,t,n){return function(t,r){return Zone.current.run(e,U,r,n)}})}h(U),w(U),l("MutationObserver"),l("WebKitMutationObserver"),l("FileReader"),d(),E(U),j(U);var Q=T("xhrTask"),Y=T("xhrSync");U.navigator&&U.navigator.geolocation&&t(U.navigator.geolocation,["getCurrentPosition","watchPosition"])}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){return function(){return t.apply(this,e(arguments,r+"."+a))}}(i))},a=0;a<n.length;a++)o(a)}function n(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||{enumerable:!0,configurable:!0};delete n.writable,delete n.value;var r=t.substr(2),o="_"+t;n.set=function(e){if(this[o]&&this.removeEventListener(r,this[o]),"function"==typeof e){var t=function(t){var n;n=e.apply(this,arguments),void 0==n||n||t.preventDefault()};this[o]=t,this.addEventListener(r,t,!1)}else this[o]=null},n.get=function(){return this[o]||null},Object.defineProperty(e,t,n)}function r(e,t){var r=[];for(var o in e)"on"==o.substr(0,2)&&r.push(o);for(var a=0;a<r.length;a++)n(e,r[a]);if(t)for(var i=0;i<t.length;i++)n(e,"on"+t[i])}function o(e,t,n,r,o){var a=e[Z];if(a)for(var i=0;i<a.length;i++){var s=a[i],c=s.data,u=c.handler;if((c.handler===t||u.listener===t)&&c.useCapturing===r&&c.eventName===n)return o&&a.splice(i,1),s}return null}function a(e,t,n){var r=e[Z];r||(r=e[Z]=[]),n?r.unshift(t):r.push(t)}function i(e,t,n,r,i){function s(e){var t=e.data;return a(t.target,e,i),t.target[u](t.eventName,e.invoke,t.useCapturing)}function c(e){var t=e.data;o(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.target[l](t.eventName,e.invoke,t.useCapturing)}void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===i&&(i=!1);var u=S(e),l=S(t),f=!n&&void 0;return function(t,n){var a=n[0],i=n[1],l=n[2]||f,p=t||D,h=null;"function"==typeof i?h=i:i&&i.handleEvent&&(h=function(e){return i.handleEvent(e)});var d=!1;try{d=i&&"[object FunctionWrapper]"===i.toString()}catch(k){return}if(!h||d)return p[u](a,i,l);if(!r){var v=o(p,i,a,l,!1);if(v)return p[u](a,v.invoke,l)}var g=Zone.current,y=p.constructor.name+"."+e+":"+a,b={target:p,eventName:a,name:a,useCapturing:l,handler:i};g.scheduleEventTask(y,h,b,s,c)}}function s(e,t){void 0===t&&(t=!0);var n=S(e),r=!t&&void 0;return function(e,t){var a=t[0],i=t[1],s=t[2]||r,c=e||D,u=o(c,i,a,s,!0);u?u.zone.cancelTask(u):c[n](a,i,s)}}function c(e){return!(!e||!e.addEventListener)&&(f(e,z,function(){return L}),f(e,I,function(){return C}),!0)}function u(t){var n=D[t];if(n){D[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[M]=new n;break;case 1:this[M]=new n(r[0]);break;case 2:this[M]=new n(r[0],r[1]);break;case 3:this[M]=new n(r[0],r[1],r[2]);break;case 4:this[M]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}};var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?D[t].prototype[e]=function(){return this[M][e].apply(this[M],arguments)}:Object.defineProperty(D[t].prototype,e,{set:function(n){"function"==typeof n?this[M][e]=Zone.current.wrap(n,t+"."+e):this[M][e]=n},get:function(){return this[M][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(D[t][r]=n[r])}}function l(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(n){return function(){return t(this,arguments)}}}function f(e,t,n){for(var r=e;r&&Object.getOwnPropertyNames(r).indexOf(t)===-1;)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=S(t);return r&&!(o=r[a])&&(o=r[a]=r[t],r[t]=l(t,n(o,a,t))),o}function p(e,t,n,r){function o(t){var n=t.data;return n.args[0]=function(){t.invoke.apply(this,arguments),delete c[n.handleId]},n.handleId=i.apply(e,n.args),c[n.handleId]=t,t}function a(e){return delete c[e.data.handleId],s(e.data.handleId)}var i=null,s=null;t+=r,n+=r;var c={};i=f(e,t,function(n){return function(i,s){if("function"==typeof s[0]){var c=Zone.current,u={handleId:null,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:null,args:s},l=c.scheduleMacroTask(t,s[0],u,o,a);if(!l)return l;var f=l.data.handleId;return f.ref&&f.unref&&(l.ref=f.ref.bind(f),l.unref=f.unref.bind(f)),l}return n.apply(e,s)}}),s=f(e,n,function(t){return function(n,r){var o="number"==typeof r[0]?c[r[0]]:r[0];o&&"string"==typeof o.type?(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}function h(){Object.defineProperty=function(e,t,n){if(k(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=v(e,t,n)),g(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=v(e,n,t[n])}),R(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=H(e,t);return k(e,t)&&(n.configurable=!1),n}}function d(e,t,n){var r=n.configurable;return n=v(e,t,n),g(e,t,n,r)}function k(e,t){return e&&e[x]&&e[x][t]}function v(e,t,n){return n.configurable=!0,n.configurable||(e[x]||F(e,x,{writable:!0,value:{}}),e[x][t]=!0),n}function g(e,t,n,r){try{return F(e,t,n)}catch(o){if(!n.configurable)throw o;"undefined"==typeof r?delete n.configurable:n.configurable=r;try{return F(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=a.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function y(e){var t=[],n=e.wtf;n?t=q.split(",").map(function(e){return"HTML"+e+"Element"}).concat(B):e[W]?t.push(W):t=B;for(var r=0;r<t.length;r++){var o=e[t[r]];c(o&&o.prototype)}}function b(e){var t=e.WebSocket;e.EventTarget||c(t.prototype),e.WebSocket=function(e,n){var o,a=arguments.length>1?new t(e,n):new t(e),i=Object.getOwnPropertyDescriptor(a,"onmessage");return i&&i.configurable===!1?(o=Object.create(a),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return a[e].apply(a,arguments)}})):o=a,r(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}function m(e){if(!P){var t="undefined"!=typeof WebSocket;T()?(j&&r(HTMLElement.prototype,A),r(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,null),r(IDBRequest.prototype,null),r(IDBOpenDBRequest.prototype,null),r(IDBDatabase.prototype,null),r(IDBTransaction.prototype,null),r(IDBCursor.prototype,null)),t&&r(WebSocket.prototype,null)):(w(),u("XMLHttpRequest"),t&&b(e))}}function T(){if(j&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{get:function(){return!0}});var t=new XMLHttpRequest,n=!!t.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{}),n}function w(){for(var e=function(e){var t=A[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][X]&&(t=Zone.current.wrap(o[n],r),t[X]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<A.length;t++)e(t)}function _(e){if(j&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),d(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])}}}function E(e){function t(e){var t=e[Q];return t}function n(e){var t=e.data;t.target.addEventListener("readystatechange",function(){t.target.readyState===t.target.DONE&&(t.aborted||e.invoke())});var n=t.target[Q];return n||(t.target[Q]=e),i.apply(t.target,t.args),e}function r(){}function o(e){var t=e.data;return t.aborted=!0,s.apply(t.target,t.args)}var a=f(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[Y]=0==t[2],a.apply(e,t)}}),i=f(e.XMLHttpRequest.prototype,"send",function(){return function(e,t){var a=Zone.current;if(e[Y])return i.apply(e,t);var s={target:e,isPeriodic:!1,delay:null,args:t,aborted:!1};return a.scheduleMacroTask("XMLHttpRequest.send",r,s,n,o)}}),s=f(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,n){var r=t(e);if(r&&"string"==typeof r.type){if(null==r.cancelFn)return;r.zone.cancelTask(r)}}})}var S=(function(e){function t(e){return"__zone_symbol__"+e}function n(){0===O&&0===E.length&&(e[m]?e[m].resolve(0)[T](a):e[b](a,0))}function r(e){n(),E.push(e)}function o(e){var t=e&&e.rejection;t&&console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0),console.error(e)}function a(){if(!S){for(S=!0;E.length;){var e=E;E=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){o(r)}}}for(;D.length;)for(var a=function(){var e=D.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};D.length;)a();S=!1}}function i(e){return e&&e.then}function s(e){return e}function c(e){return M.reject(e)}function u(e,t){return function(n){l(e,t,n)}}function l(e,t,r){if(e[P]===z)if(r instanceof M&&r.hasOwnProperty(P)&&r.hasOwnProperty(j)&&r[P]!==z)f(r),l(e,r[P],r[j]);else if(i(r))r.then(u(e,t),u(e,!1));else{e[P]=t;var o=e[j];e[j]=r;for(var a=0;a<o.length;)p(e,o[a++],o[a++],o[a++],o[a++]);if(0==o.length&&t==L){e[P]=C;try{throw new Error("Uncaught (in promise): "+r+(r&&r.stack?"\n"+r.stack:""))}catch(s){var c=s;c.rejection=r,c.promise=e,c.zone=k.current,c.task=k.currentTask,D.push(c),n()}}}return e}function f(e){if(e[P]===C){e[P]=L;for(var t=0;t<D.length;t++)if(e===D[t].promise){D.splice(t,1);break}}}function p(e,t,n,r,o){f(e);var a=e[P]?r||s:o||c;t.scheduleMicroTask(Z,function(){try{l(n,!0,t.run(a,null,[e[j]]))}catch(r){l(n,!1,r)}})}function h(e){var n=e.prototype,r=n[t("then")]=n.then;n.then=function(e,t){var n=this;return new M(function(e,t){r.call(n,e,t)}).then(e,t)}}function d(){var e=B.apply(this,arguments);if(e.originalStack=e.stack,d[A]&&e.originalStack){for(var t=e.originalStack.split("\n"),n=w,r=0;t[r]!==q&&r<t.length;)r++;for(;r<t.length&&n;r++){var o=t[r];if(o.trim()){var a=W.hasOwnProperty(o)&&W[o];a===x.blackList?(t.splice(r,1),r--):a===x.trasition?n.parent?(t[r]+=" ["+n.parent.zone.name+" => "+n.zone.name+"]",n=n.parent):n=null:t[r]+=" ["+n.zone.name+"]"}}e.stack=e.zoneAwareStack=t.join("\n")}return e}if(e.Zone)throw new Error("Zone already loaded.");var k=function(){function n(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,t)}return n.assertZonePatched=function(){if(e.Promise!==M)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(n,"current",{get:function(){return w.zone},enumerable:!0,configurable:!0}),Object.defineProperty(n,"currentTask",{get:function(){return _},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),n.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},n.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},n.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},n.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},n.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),w=new y(w,this);try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{w=w.parent}},n.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),w=new y(w,this);try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=w.parent}},n.prototype.runTask=function(e,t,n){if(e.runCount++,e.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+e.zone.name+"; Execution: "+this.name+")");var r=_;_=e,w=new y(w,this);try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=w.parent,_=r}},n.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new g("microTask",this,e,t,n,r,null))},n.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("macroTask",this,e,t,n,r,o))},n.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("eventTask",this,e,t,n,r,o))},n.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},n.__symbol__=t,n}(),v=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._hasTaskZS=n&&(n.onHasTask?n:t._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?t:t._hasTaskDlgt)}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new k(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this.zone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this.zone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this.zone,e,t)},e.prototype.scheduleTask=function(e,t){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this.zone,e,t);if(t.scheduleFn)t.scheduleFn(t);else{if("microTask"!=t.type)throw new Error("Task is missing scheduleFn.");r(t)}return t}finally{e==this.zone&&this._updateTaskCount(t.type,1)}},e.prototype.invokeTask=function(e,t,n,r){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this.zone,e,t,n,r):t.callback.apply(n,r)}finally{e!=this.zone||"eventTask"==t.type||t.data&&t.data.isPeriodic||this._updateTaskCount(t.type,-1)}},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this.zone,e,t);else{if(!t.cancelFn)throw new Error("Task does not support cancellation, or is already canceled.");n=t.cancelFn(t)}return e==this.zone&&this._updateTaskCount(t.type,-1),n},e.prototype.hasTask=function(e,t){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this.zone,e,t)},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};try{this.hasTask(this.zone,a)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(e,t)}}},e}(),g=function(){function e(e,t,n,r,o,i,s){this.runCount=0,this.type=e,this.zone=t,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=s,this.callback=r;var c=this;this.invoke=function(){O++;try{return t.runTask(c,this,arguments)}finally{1==O&&a(),O--}}}return e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e}(),y=function(){function e(e,t){this.parent=e,this.zone=t}return e}(),b=t("setTimeout"),m=t("Promise"),T=t("then"),w=new y(null,new k(null,null)),_=null,E=[],S=!1,D=[],O=0,P=t("state"),j=t("value"),Z="Promise.then",z=null,I=!0,L=!1,C=0,M=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[P]=z,n[j]=[];try{t&&t(u(n,I),u(n,L))}catch(r){l(n,!1,r)}}return e.resolve=function(e){return l(new this(null),I,e)},e.reject=function(e){return l(new this(null),L,e)},e.race=function(e){function t(e){a&&(a=r(e))}function n(e){a&&(a=o(e))}for(var r,o,a=new this(function(e,t){n=[e,t],r=n[0],o=n[1];var n}),s=0,c=e;s<c.length;s++){var u=c[s];i(u)||(u=this.resolve(u)),u.then(t,n)}return a},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),o=0,a=[],s=0,c=e;s<c.length;s++){var u=c[s];i(u)||(u=this.resolve(u)),u.then(function(e){return function(n){a[e]=n,o--,o||t(a)}}(o),n),o++}return o||t(a),r},e.prototype.then=function(e,t){var n=new this.constructor(null),r=k.current;return this[P]==z?this[j].push(r,n,e,t):p(this,r,n,e,t),n},e.prototype["catch"]=function(e){return this.then(null,e)},e}();M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;var F=e[t("Promise")]=e.Promise;if(e.Promise=M,F&&(h(F),"undefined"!=typeof e.fetch)){var H=void 0;try{H=e.fetch()}catch(R){H=e.fetch("about:blank")}H.then(function(){return null},function(){return null}),H.constructor!=F&&H.constructor!=M&&h(H.constructor)}Promise[k.__symbol__("uncaughtPromiseErrors")]=D;var x;!function(e){e[e.blackList=0]="blackList",e[e.trasition=1]="trasition"}(x||(x={}));var q,B=e[t("Error")]=e.Error,W={};e.Error=d;var A="stackRewrite";d.prototype=B.prototype,d[k.__symbol__("blacklistedStackFrames")]=W,d[A]=!1,B.hasOwnProperty("stackTraceLimit")&&(B.stackTraceLimit=Math.max(B.stackTraceLimit,15),Object.defineProperty(d,"stackTraceLimit",{get:function(){return B.stackTraceLimit},set:function(e){return B.stackTraceLimit=e}}));var X=k.current.fork({name:"detect",onInvoke:function(e,t,n,r,o,a,i){return e.invoke(n,r,o,a,i)},onHandleError:function(e,t,n,r){if(r.originalStack&&Error===d)for(var o=r.originalStack.split(/\n/),a=!1,i=!1,s=!1;o.length;){var c=o.shift();if(/:\d+:\d+/.test(c)){var u=c.split("(")[0].split("@")[0],l=x.trasition;if(u.indexOf("ZoneAwareError")!==-1&&(q=c),u.indexOf("runGuarded")!==-1?i=!0:u.indexOf("runTask")!==-1?s=!0:u.indexOf("run")!==-1?a=!0:l=x.blackList,W[c]=l,a&&i&&s){d[A]=!0;break}}}return!1}}),G=function(){X.run(function(){X.runGuarded(function(){throw new Error("blacklistStackFrames")})})};return X.runTask(X.scheduleMacroTask("detect",G,null,function(){return null},null)),e.Zone=k}("object"==typeof window&&window||"object"==typeof self&&self||global),Zone.__symbol__),D="object"==typeof window&&window||"object"==typeof self&&self||global,O="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,P="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),j=!P&&!O&&!("undefined"==typeof window||!window.HTMLElement),Z=S("eventTasks"),z="addEventListener",I="removeEventListener",L=i(z,I),C=s(I),M=S("originalInstance"),F=Object[S("defineProperty")]=Object.defineProperty,H=Object[S("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,R=Object.create,x=S("unconfigurables"),q="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",B="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),W="EventTarget",A="copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror".split(" "),X=S("unbound"),G="set",N="clear",U=["alert","prompt","confirm"],K="object"==typeof window&&window||"object"==typeof self&&self||global;p(K,G,N,"Timeout"),p(K,G,N,"Interval"),p(K,G,N,"Immediate"),p(K,"request","cancel","AnimationFrame"),p(K,"mozRequest","mozCancel","AnimationFrame"),p(K,"webkitRequest","webkitCancel","AnimationFrame");for(var V=0;V<U.length;V++){var J=U[V];f(K,J,function(e,t,n){return function(t,r){return Zone.current.run(e,K,r,n)}})}y(K),m(K),u("MutationObserver"),u("WebKitMutationObserver"),u("FileReader"),h(),_(K),E(K);var Q=S("xhrTask"),Y=S("xhrSync");K.navigator&&K.navigator.geolocation&&t(K.navigator.geolocation,["getCurrentPosition","watchPosition"])}); |
{ | ||
"name": "zone.js", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Zones for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/zone-node.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
362247
7839