Socket
Socket
Sign inDemoInstall

zone.js

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zone.js - npm Package Compare versions

Comparing version 0.6.12 to 0.6.13

dist/proxy-zone.js

2

dist/async-test.js

@@ -86,3 +86,3 @@ /******/ (function(modules) { // webpackBootstrap

if (result) {
this._failCallback(error.message ? error.message : 'unknown error');
this._failCallback(error);
this._alreadyErrored = true;

@@ -89,0 +89,0 @@ }

@@ -115,2 +115,3 @@ /******/ (function(modules) { // webpackBootstrap

this._lastError = null;
this._uncaughtPromiseErrors = Promise[Zone['__symbol__']('uncaughtPromiseErrors')];
this.pendingPeriodicTimers = [];

@@ -209,3 +210,4 @@ this.pendingTimers = [];

FakeAsyncTestZoneSpec.prototype._resetLastErrorAndThrow = function () {
var error = this._lastError;
var error = this._lastError || this._uncaughtPromiseErrors[0];
this._uncaughtPromiseErrors.length = 0;
this._lastError = null;

@@ -224,11 +226,15 @@ throw error;

FakeAsyncTestZoneSpec.prototype.flushMicrotasks = function () {
var _this = this;
FakeAsyncTestZoneSpec.assertInZone();
var flushErrors = function () {
if (_this._lastError !== null || _this._uncaughtPromiseErrors.length) {
// If there is an error stop processing the microtask queue and rethrow the error.
_this._resetLastErrorAndThrow();
}
};
while (this._microtasks.length > 0) {
var microtask = this._microtasks.shift();
microtask();
if (this._lastError !== null) {
// If there is an error stop processing the microtask queue and rethrow the error.
this._resetLastErrorAndThrow();
}
}
flushErrors();
};

@@ -235,0 +241,0 @@ FakeAsyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {

@@ -47,3 +47,3 @@ /******/ (function(modules) { // webpackBootstrap

/* WEBPACK VAR INJECTION */(function(global) {'use strict';
'use strict';
// Patch jasmine's it and fit functions so that the `done` wrapCallback always resets the zone

@@ -54,4 +54,2 @@ // to the jasmine zone, which should be the root zone. (angular/zone.js#91)

}
var SET_TIMEOUT = '__zone_symbol__setTimeout';
var _global = typeof window == 'undefined' ? global : window;
// When you have in async test (test with `done` argument) jasmine will

@@ -65,5 +63,9 @@ // execute the next test synchronously in the done handler. This makes sense

jasmine.QueueRunner = (function (SuperQueueRunner) {
var originalZone = Zone.current;
// Subclass the `QueueRunner` and override the `clearStack` method.
function alwaysClearStack(fn) {
_global[SET_TIMEOUT](fn, 0);
var zone = Zone.current.getZoneWith('JasmineClearStackZone')
|| Zone.current.getZoneWith('ProxyZoneSpec')
|| originalZone;
zone.scheduleMicroTask('jasmineCleanStack', fn);
}

@@ -78,5 +80,4 @@ function QueueRunner(options) {

/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }
/******/ ]);

@@ -1,1 +0,1 @@

!function(e){function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,exports){(function(e){"use strict";if(!Zone)throw new Error("zone.js does not seem to be installed");var n="__zone_symbol__setTimeout",t="undefined"==typeof window?e:window;jasmine.QueueRunner=function(e){function o(e){t[n](e,0)}function r(n){n.clearStack=o,e.call(this,n)}return r.prototype=e.prototype,r}(jasmine.QueueRunner)}).call(exports,function(){return this}())}]);
!function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,exports){"use strict";if(!Zone)throw new Error("zone.js does not seem to be installed");jasmine.QueueRunner=function(e){function n(e){var n=Zone.current.getZoneWith("JasmineClearStackZone")||Zone.current.getZoneWith("ProxyZoneSpec")||t;n.scheduleMicroTask("jasmineCleanStack",e)}function r(r){r.clearStack=n,e.call(this,r)}var t=Zone.current;return r.prototype=e.prototype,r}(jasmine.QueueRunner)}]);

@@ -1,1 +0,1 @@

!function(n){function e(t){if(o[t])return o[t].exports;var r=o[t]={exports:{},id:t,loaded:!1};return n[t].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=n,e.c=o,e.p="",e(0)}([function(n,exports){(function(n){!function(n){function e(n,o){if(!o)return null;var t={};for(var r in n)if(n.hasOwnProperty(r)){var a=n[r];switch(typeof a){case"object":var c=a&&a.constructor&&a.constructor.name;a=c==Object.name?e(a,o-1):c;break;case"function":a=a.name||void 0}t[r]=a}return t}function o(n){var e=n.name;for(n=n.parent;null!=n;)e=n.name+"::"+e,n=n.parent;return e}var t=null,r=null,a=function(){var e=n.wtf;return e&&(t=e.trace)?(r=t.events,!0):!1}(),c=function(){function n(){this.name="WTF"}return n.prototype.onFork=function(e,t,r,a){var c=e.fork(r,a);return n.forkInstance(o(r),c.name),c},n.prototype.onInvoke=function(e,a,c,i,s,u,p){var f=n.invokeScope[p];return f||(f=n.invokeScope[p]=r.createScope("Zone:invoke:"+p+"(ascii zone)")),t.leaveScope(f(o(c)),e.invoke(c,i,s,u,p))},n.prototype.onHandleError=function(n,e,o,t){return n.handleError(o,t)},n.prototype.onScheduleTask=function(t,a,c,i){var s=i.type+":"+i.source,u=n.scheduleInstance[s];u||(u=n.scheduleInstance[s]=r.createInstance("Zone:schedule:"+s+"(ascii zone, any data)"));var p=t.scheduleTask(c,i);return u(o(c),e(i.data,2)),p},n.prototype.onInvokeTask=function(e,a,c,i,s,u){var p=i.source,f=n.invokeTaskScope[p];return f||(f=n.invokeTaskScope[p]=r.createScope("Zone:invokeTask:"+p+"(ascii zone)")),t.leaveScope(f(o(c)),e.invokeTask(c,i,s,u))},n.prototype.onCancelTask=function(t,a,c,i){var s=i.source,u=n.cancelInstance[s];u||(u=n.cancelInstance[s]=r.createInstance("Zone:cancel:"+s+"(ascii zone, any options)"));var p=t.cancelTask(c,i);return u(o(c),e(i.data,2)),p},n.forkInstance=a&&r.createInstance("Zone:fork(ascii zone, ascii newZone)"),n.scheduleInstance={},n.cancelInstance={},n.invokeScope={},n.invokeTaskScope={},n}();Zone.wtfZoneSpec=a?new c:null}("undefined"==typeof window?n:window)}).call(exports,function(){return this}())}]);
!function(n){function e(t){if(o[t])return o[t].exports;var r=o[t]={exports:{},id:t,loaded:!1};return n[t].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=n,e.c=o,e.p="",e(0)}([function(n,exports){(function(n){!function(n){function e(n,o){if(!o)return null;var t={};for(var r in n)if(n.hasOwnProperty(r)){var a=n[r];switch(typeof a){case"object":var c=a&&a.constructor&&a.constructor.name;a=c==Object.name?e(a,o-1):c;break;case"function":a=a.name||void 0}t[r]=a}return t}function o(n){var e=n.name;for(n=n.parent;null!=n;)e=n.name+"::"+e,n=n.parent;return e}var t=null,r=null,a=function(){var e=n.wtf;return!(!e||!(t=e.trace))&&(r=t.events,!0)}(),c=function(){function n(){this.name="WTF"}return n.prototype.onFork=function(e,t,r,a){var c=e.fork(r,a);return n.forkInstance(o(r),c.name),c},n.prototype.onInvoke=function(e,a,c,i,s,u,p){var f=n.invokeScope[p];return f||(f=n.invokeScope[p]=r.createScope("Zone:invoke:"+p+"(ascii zone)")),t.leaveScope(f(o(c)),e.invoke(c,i,s,u,p))},n.prototype.onHandleError=function(n,e,o,t){return n.handleError(o,t)},n.prototype.onScheduleTask=function(t,a,c,i){var s=i.type+":"+i.source,u=n.scheduleInstance[s];u||(u=n.scheduleInstance[s]=r.createInstance("Zone:schedule:"+s+"(ascii zone, any data)"));var p=t.scheduleTask(c,i);return u(o(c),e(i.data,2)),p},n.prototype.onInvokeTask=function(e,a,c,i,s,u){var p=i.source,f=n.invokeTaskScope[p];return f||(f=n.invokeTaskScope[p]=r.createScope("Zone:invokeTask:"+p+"(ascii zone)")),t.leaveScope(f(o(c)),e.invokeTask(c,i,s,u))},n.prototype.onCancelTask=function(t,a,c,i){var s=i.source,u=n.cancelInstance[s];u||(u=n.cancelInstance[s]=r.createInstance("Zone:cancel:"+s+"(ascii zone, any options)"));var p=t.cancelTask(c,i);return u(o(c),e(i.data,2)),p},n.forkInstance=a&&r.createInstance("Zone:fork(ascii zone, ascii newZone)"),n.scheduleInstance={},n.cancelInstance={},n.invokeScope={},n.invokeTaskScope={},n}();Zone.wtfZoneSpec=a?new c:null}("undefined"==typeof window?n:window)}).call(exports,function(){return this}())}]);

@@ -62,3 +62,3 @@ /******/ (function(modules) { // webpackBootstrap

timers_1.patchTimer(_global, set, clear, 'Immediate');
timers_1.patchTimer(_global, 'request', 'cancelMacroTask', 'AnimationFrame');
timers_1.patchTimer(_global, 'request', 'cancel', 'AnimationFrame');
timers_1.patchTimer(_global, 'mozRequest', 'mozCancel', 'AnimationFrame');

@@ -154,2 +154,5 @@ timers_1.patchTimer(_global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');

var Zone = (function (global) {
if (global.Zone) {
throw new Error('Zone already loaded.');
}
var Zone = (function () {

@@ -188,9 +191,15 @@ function Zone(parent, zoneSpec) {

Zone.prototype.get = function (key) {
var zone = this.getZoneWith(key);
if (zone)
return zone._properties[key];
};
Zone.prototype.getZoneWith = function (key) {
var current = this;
while (current) {
if (current._properties.hasOwnProperty(key)) {
return current._properties[key];
return current;
}
current = current._parent;
}
return null;
};

@@ -433,2 +442,10 @@ Zone.prototype.fork = function (zoneSpec) {

}
ZoneTask.prototype.toString = function () {
if (this.data && typeof this.data.handleId !== 'undefined') {
return this.data.handleId;
}
else {
return this.toString();
}
};
return ZoneTask;

@@ -465,3 +482,3 @@ }());

if (rejection) {
console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection);
console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);
}

@@ -487,6 +504,4 @@ console.error(e);

while (_uncaughtPromiseErrors.length) {
var uncaughtPromiseErrors = _uncaughtPromiseErrors;
_uncaughtPromiseErrors = [];
var _loop_1 = function(i) {
var uncaughtPromiseError = uncaughtPromiseErrors[i];
var _loop_1 = function() {
var uncaughtPromiseError = _uncaughtPromiseErrors.shift();
try {

@@ -499,4 +514,4 @@ uncaughtPromiseError.zone.runGuarded(function () { throw uncaughtPromiseError; });

};
for (var i = 0; i < uncaughtPromiseErrors.length; i++) {
_loop_1(i);
while (_uncaughtPromiseErrors.length) {
_loop_1();
}

@@ -588,2 +603,5 @@ }

var promise = this;
if (!(promise instanceof ZoneAwarePromise)) {
throw new Error('Must be an instanceof Promise.');
}
promise[symbolState] = UNRESOLVED;

@@ -646,3 +664,3 @@ promise[symbolValue] = []; // queue;

ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {
var chainPromise = new ZoneAwarePromise(null);
var chainPromise = new this.constructor(null);
var zone = Zone.current;

@@ -675,2 +693,4 @@ if (this[symbolState] == UNRESOLVED) {

}
// This is not part of public API, but it is usefull for tests, so we expose it.
Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
return global.Zone = Zone;

@@ -688,3 +708,3 @@ })(typeof window === 'undefined' ? global : window);

var WTF_ISSUE_555 = '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';
var NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex'.split(',');
var NO_EVENT_TARGET = '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'.split(',');
var EVENT_TARGET = 'EventTarget';

@@ -960,2 +980,5 @@ function eventTargetPatch(_global) {

for (prop in instance) {
// https://bugs.webkit.org/show_bug.cgi?id=44721
if (className === 'XMLHttpRequest' && prop === 'responseBlob')
continue;
(function (prop) {

@@ -1044,6 +1067,7 @@ if (typeof instance[prop] === 'function') {

}
var originalConfigurableFlag = desc.configurable;
if (prop !== 'prototype') {
desc = rewriteDescriptor(obj, prop, desc);
}
return _defineProperty(obj, prop, desc);
return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);
};

@@ -1057,3 +1081,3 @@ Object.defineProperties = function (obj, props) {

Object.create = function (obj, proto) {
if (typeof proto === 'object') {
if (typeof proto === 'object' && !Object.isFrozen(proto)) {
Object.keys(proto).forEach(function (prop) {

@@ -1076,4 +1100,5 @@ proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);

function _redefineProperty(obj, prop, desc) {
var originalConfigurableFlag = desc.configurable;
desc = rewriteDescriptor(obj, prop, desc);
return _defineProperty(obj, prop, desc);
return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);
}

@@ -1095,2 +1120,22 @@ exports._redefineProperty = _redefineProperty;

}
function _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) {
try {
return _defineProperty(obj, prop, desc);
}
catch (e) {
if (desc.configurable) {
// In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's retry with the original flag value
if (typeof originalConfigurableFlag == 'undefined') {
delete desc.configurable;
}
else {
desc.configurable = originalConfigurableFlag;
}
return _defineProperty(obj, prop, desc);
}
else {
throw e;
}
}
}

@@ -1306,3 +1351,13 @@

};
return zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);
var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);
if (!task) {
return task;
}
// Node.js must additionally support the ref and unref functions.
var handle = task.data.handleId;
if (handle.ref && handle.unref) {
task.ref = handle.ref.bind(handle);
task.unref = handle.unref.bind(handle);
}
return task;
}

@@ -1309,0 +1364,0 @@ else {

@@ -136,9 +136,18 @@ /**

* If the current zone does not have a key, the request is delegated to the parent zone. Use
* [ZoneSpec.properties] to configure the set of properties asseciated with the current zone.
* [ZoneSpec.properties] to configure the set of properties associated with the current zone.
*
* @param key The key to retrieve.
* @returns {any} Tha value for the key, or `undefined` if not found.
* @returns {any} The value for the key, or `undefined` if not found.
*/
get(key: string): any;
/**
* Returns a Zone which defines a `key`.
*
* Recursively search the parent Zone until a Zone which has a property `key` is found.
*
* @param key The key to use for identification of the returned zone.
* @returns {Zone} The Zone which defines the `key`, `null` if not found.
*/
getZoneWith(key: string): Zone;
/**
* Used to create a child zone.

@@ -376,2 +385,6 @@ *

delay?: number;
/**
* identifier returned by the native setTimeout.
*/
handleId?: number;
}

@@ -378,0 +391,0 @@ /**

@@ -1,1 +0,1 @@

!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,exports,t){(function(e){"use strict";function n(e){function t(e){var t=e[v];return t}function n(e){var t=e.data;t.target.addEventListener("readystatechange",function(){t.target.readyState===XMLHttpRequest.DONE&&(t.aborted||e.invoke())});var n=t.target[v];return n||(t.target[v]=e),a.apply(t.target,t.args),e}function r(){}function o(e){var t=e.data;return t.aborted=!0,i.apply(t.target,t.args)}var a=c.patchMethod(e.XMLHttpRequest.prototype,"send",function(){return function(e,t){var a=Zone.current,i={target:e,isPeriodic:!1,delay:null,args:t,aborted:!1};return a.scheduleMacroTask("XMLHttpRequest.send",r,i,n,o)}}),i=c.patchMethod(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)}}})}t(1);var r=t(2),o=t(4),a=t(5),i=t(6),s=t(8),c=t(3),u="set",l="clear",p=["alert","prompt","confirm"],h="undefined"==typeof window?e:window;s.patchTimer(h,u,l,"Timeout"),s.patchTimer(h,u,l,"Interval"),s.patchTimer(h,u,l,"Immediate"),s.patchTimer(h,"request","cancelMacroTask","AnimationFrame"),s.patchTimer(h,"mozRequest","mozCancel","AnimationFrame"),s.patchTimer(h,"webkitRequest","webkitCancel","AnimationFrame");for(var f=0;f<p.length;f++){var d=p[f];c.patchMethod(h,d,function(e,t,n){return function(t,r){return Zone.current.run(e,h,r,n)}})}r.eventTargetPatch(h),i.propertyDescriptorPatch(h),c.patchClass("MutationObserver"),c.patchClass("WebKitMutationObserver"),c.patchClass("FileReader"),o.propertyPatch(),a.registerElementPatch(h),n(h);var v=c.zoneSymbol("xhrTask");h.navigator&&h.navigator.geolocation&&c.patchPrototype(h.navigator.geolocation,["getCurrentPosition","watchPosition"])}).call(exports,function(){return this}())},function(e,exports){(function(e){(function(e){function t(e){return"__zone_symbol__"+e}function n(){D||T||0!=b.length||(e[y]?e[y].resolve(0)[g](a):e[k](a,0))}function r(e){n(),b.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),console.error(e)}function a(){if(!_){for(_=!0;b.length;){var e=b;b=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){o(r)}}}for(;w.length;){var a=w;w=[];for(var i=function(e){var t=a[e];try{t.zone.runGuarded(function(){throw t})}catch(n){o(n)}},t=0;t<a.length;t++)i(t)}_=!1,D=!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[S]===O)if(r instanceof M&&r[S]!==O)p(r),l(e,r[S],r[E]);else if(i(r))r.then(u(e,t),u(e,!1));else{e[S]=t;var o=e[E];e[E]=r;for(var a=0;a<o.length;)h(e,o[a++],o[a++],o[a++],o[a++]);if(0==o.length&&t==Z){e[S]=C;try{throw new Error("Uncaught (in promise): "+r)}catch(s){var c=s;c.rejection=r,c.promise=e,c.zone=f.current,c.task=f.currentTask,w.push(c),n()}}}return e}function p(e){if(e[S]===C){e[S]=Z;for(var t=0;t<w.length;t++)if(e===w[t].promise){w.splice(t,1);break}}}function h(e,t,n,r,o){p(e);var a=e[S]?r||s:o||c;t.scheduleMicroTask(P,function(){try{l(n,!0,t.run(a,null,[e[E]]))}catch(r){l(n,!1,r)}})}var f=function(){function e(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new d(this,this._parent&&this._parent._zoneDelegate,t)}return Object.defineProperty(e,"current",{get:function(){return m},enumerable:!0,configurable:!0}),Object.defineProperty(e,"currentTask",{get:function(){return T},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),e.prototype.get=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t._properties[e];t=t._parent}},e.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},e.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)}},e.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var o=m;m=this;try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{m=o}},e.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var o=m;m=this;try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{m=o}},e.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=T;T=e;var o=m;m=this;try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{m=o,T=r}},e.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new v("microTask",this,e,t,n,r,null))},e.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new v("macroTask",this,e,t,n,r,o))},e.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new v("eventTask",this,e,t,n,r,o))},e.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},e.__symbol__=t,e}(),d=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 f(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):!0},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(0>o)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}(),v=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(){try{return t.runTask(c,this,arguments)}finally{a()}}}return e}(),k=t("setTimeout"),y=t("Promise"),g=t("then"),m=new f(null,null),T=null,b=[],_=!1,w=[],D=!1,S=t("state"),E=t("value"),P="Promise.then",O=null,z=!0,Z=!1,C=0,M=function(){function e(e){var t=this;t[S]=O,t[E]=[];try{e&&e(u(t,z),u(t,Z))}catch(n){l(t,!1,n)}}return e.resolve=function(e){return l(new this(null),z,e)},e.reject=function(e){return l(new this(null),Z,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){r=e,o=t}),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){function t(e){o&&r(e),o=null}for(var n,r,o=new this(function(e,t){n=e,r=t}),a=0,s=[],c=0,u=e;c<u.length;c++){var l=u[c];i(l)||(l=this.resolve(l)),l.then(function(e){return function(t){s[e]=t,a--,o&&!a&&n(s)}}(a),t),a++}return a||n(s),o},e.prototype.then=function(t,n){var r=new e(null),o=f.current;return this[S]==O?this[E].push(o,r,t,n):h(this,o,r,t,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}(),I=e[t("Promise")]=e.Promise;if(e.Promise=M,I){var j=I.prototype,L=j[t("then")]=j.then;j.then=function(e,t){var n=this;return new M(function(e,t){L.call(n,e,t)}).then(e,t)}}return e.Zone=f})("undefined"==typeof window?e:window)}).call(exports,function(){return this}())},function(e,exports,t){"use strict";function n(e){var t=[],n=e.wtf;n?t=o.split(",").map(function(e){return"HTML"+e+"Element"}).concat(a):e[i]?t.push(i):t=a;for(var s=0;s<t.length;s++){var c=e[t[s]];r.patchEventTargetMethods(c&&c.prototype)}}var r=t(3),o="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",a="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex".split(","),i="EventTarget";exports.eventTargetPatch=n},function(e,exports){(function(e){"use strict";function t(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 n(e,n){for(var r=e.constructor.name,o=function(o){var a=n[o],i=e[a];i&&(e[a]=function(e){return function(){return e.apply(this,t(arguments,r+"."+a))}}(i))},a=0;a<n.length;a++)o(a)}function r(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]},Object.defineProperty(e,t,n)}function o(e,t){var n=[];for(var o in e)"on"==o.substr(0,2)&&n.push(o);for(var a=0;a<n.length;a++)r(e,n[a]);if(t)for(var i=0;i<t.length;i++)r(e,"on"+t[i])}function a(e,t,n,r,o){var a=e[k];if(a)for(var i=0;i<a.length;i++){var s=a[i],c=s.data;if(c.handler===t&&c.useCapturing===r&&c.eventName===n)return o&&a.splice(i,1),s}return null}function i(e,t){var n=e[k];n||(n=e[k]=[]),n.push(t)}function s(e){var t=e.data;return i(t.target,e),t.target[m](t.eventName,e.invoke,t.useCapturing)}function c(e){var t=e.data;a(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.target[T](t.eventName,e.invoke,t.useCapturing)}function u(e,t){var n=t[0],r=t[1],o=t[2]||!1,i=e||v,u=null;"function"==typeof r?u=r:r&&r.handleEvent&&(u=function(e){return r.handleEvent(e)});var l=!1;try{l=r&&"[object FunctionWrapper]"===r.toString()}catch(p){return}if(!u||l)return i[m](n,r,o);var h=a(i,r,n,o,!1);if(h)return i[m](n,h.invoke,o);var f=Zone.current,d=i.constructor.name+".addEventListener:"+n,k={target:i,eventName:n,name:n,useCapturing:o,handler:r};f.scheduleEventTask(d,u,k,s,c)}function l(e,t){var n=t[0],r=t[1],o=t[2]||!1,i=e||v,s=a(i,r,n,o,!0);s?s.zone.cancelTask(s):i[T](n,r,o)}function p(e){return e&&e.addEventListener?(d(e,y,function(){return u}),d(e,g,function(){return l}),!0):!1}function h(e){var n=v[e];if(n){v[e]=function(){var r=t(arguments,e);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)!function(t){"function"==typeof o[t]?v[e].prototype[t]=function(){return this[b][t].apply(this[b],arguments)}:Object.defineProperty(v[e].prototype,t,{set:function(n){"function"==typeof n?this[b][t]=Zone.current.wrap(n,e+"."+t):this[b][t]=n},get:function(){return this[b][t]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(v[e][r]=n[r])}}function f(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(n){return function(){return t(this,arguments)}}}function d(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=exports.zoneSymbol(t);return r&&!(o=r[a])&&(o=r[a]=r[t],r[t]=f(t,n(o,a,t))),o}exports.zoneSymbol=Zone.__symbol__;var v="undefined"==typeof window?e:window;exports.bindArguments=t,exports.patchPrototype=n,exports.isWebWorker="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,exports.isNode="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),exports.isBrowser=!exports.isNode&&!exports.isWebWorker&&!("undefined"==typeof window||!window.HTMLElement),exports.patchProperty=r,exports.patchOnProperties=o;var k=exports.zoneSymbol("eventTasks"),y="addEventListener",g="removeEventListener",m=exports.zoneSymbol(y),T=exports.zoneSymbol(g);exports.patchEventTargetMethods=p;var b=exports.zoneSymbol("originalInstance");exports.patchClass=h,exports.createNamedFn=f,exports.patchMethod=d}).call(exports,function(){return this}())},function(e,exports,t){"use strict";function n(){Object.defineProperty=function(e,t,n){if(o(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);return"prototype"!==t&&(n=a(e,t,n)),s(e,t,n)},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.keys(t).forEach(function(n){t[n]=a(e,n,t[n])}),u(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=c(e,t);return o(e,t)&&(n.configurable=!1),n}}function r(e,t,n){return n=a(e,t,n),s(e,t,n)}function o(e,t){return e&&e[l]&&e[l][t]}function a(e,t,n){return n.configurable=!0,n.configurable||(e[l]||s(e,l,{writable:!0,value:{}}),e[l][t]=!0),n}var i=t(3),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.create,l=i.zoneSymbol("unconfigurables");exports.propertyPatch=n,exports._redefineProperty=r},function(e,exports,t){"use strict";function n(e){if(o.isBrowser&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,o){return o&&o.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(o.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(o.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),r._redefineProperty(o.prototype,e,n)):o.prototype[e]=Zone.current.wrap(o.prototype[e],t)}else o.prototype[e]&&(o.prototype[e]=Zone.current.wrap(o.prototype[e],t))}),t.apply(document,[e,o])}}}var r=t(4),o=t(3);exports.registerElementPatch=n},function(e,exports,t){"use strict";function n(e){if(!i.isNode){var t="undefined"!=typeof WebSocket;r()?(i.isBrowser&&i.patchOnProperties(HTMLElement.prototype,s),i.patchOnProperties(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(i.patchOnProperties(IDBIndex.prototype,null),i.patchOnProperties(IDBRequest.prototype,null),i.patchOnProperties(IDBOpenDBRequest.prototype,null),i.patchOnProperties(IDBDatabase.prototype,null),i.patchOnProperties(IDBTransaction.prototype,null),i.patchOnProperties(IDBCursor.prototype,null)),t&&i.patchOnProperties(WebSocket.prototype,null)):(o(),i.patchClass("XMLHttpRequest"),t&&a.apply(e))}}function r(){if(i.isBrowser&&!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=s[e],n="on"+t;document.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][c]&&(t=Zone.current.wrap(o[n],r),t[c]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<s.length;t++)e(t)}var a=t(7),i=t(3),s="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(" ");exports.propertyDescriptorPatch=n;var c=i.zoneSymbol("unbound")},function(e,exports,t){"use strict";function n(e){var t=e.WebSocket;e.EventTarget||r.patchEventTargetMethods(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.patchOnProperties(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}var r=t(3);exports.apply=n},function(e,exports,t){"use strict";function n(e,t,n,o){function a(t){var n=t.data;return n.args[0]=t.invoke,n.handleId=s.apply(e,n.args),t}function i(e){return c(e.data.handleId)}var s=null,c=null;t+=o,n+=o,s=r.patchMethod(e,t,function(n){return function(r,s){if("function"==typeof s[0]){var c=Zone.current,u={handleId:null,isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:null,args:s};return c.scheduleMacroTask(t,s[0],u,a,i)}return n.apply(e,s)}}),c=r.patchMethod(e,n,function(t){return function(n,r){var o=r[0];o&&"string"==typeof o.type?(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}var r=t(3);exports.patchTimer=n}]);
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,exports,t){(function(e){"use strict";function n(e){function t(e){var t=e[v];return t}function n(e){var t=e.data;t.target.addEventListener("readystatechange",function(){t.target.readyState===XMLHttpRequest.DONE&&(t.aborted||e.invoke())});var n=t.target[v];return n||(t.target[v]=e),a.apply(t.target,t.args),e}function r(){}function o(e){var t=e.data;return t.aborted=!0,i.apply(t.target,t.args)}var a=c.patchMethod(e.XMLHttpRequest.prototype,"send",function(){return function(e,t){var a=Zone.current,i={target:e,isPeriodic:!1,delay:null,args:t,aborted:!1};return a.scheduleMacroTask("XMLHttpRequest.send",r,i,n,o)}}),i=c.patchMethod(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)}}})}t(1);var r=t(2),o=t(4),a=t(5),i=t(6),s=t(8),c=t(3),u="set",l="clear",p=["alert","prompt","confirm"],h="undefined"==typeof window?e:window;s.patchTimer(h,u,l,"Timeout"),s.patchTimer(h,u,l,"Interval"),s.patchTimer(h,u,l,"Immediate"),s.patchTimer(h,"request","cancel","AnimationFrame"),s.patchTimer(h,"mozRequest","mozCancel","AnimationFrame"),s.patchTimer(h,"webkitRequest","webkitCancel","AnimationFrame");for(var f=0;f<p.length;f++){var d=p[f];c.patchMethod(h,d,function(e,t,n){return function(t,r){return Zone.current.run(e,h,r,n)}})}r.eventTargetPatch(h),i.propertyDescriptorPatch(h),c.patchClass("MutationObserver"),c.patchClass("WebKitMutationObserver"),c.patchClass("FileReader"),o.propertyPatch(),a.registerElementPatch(h),n(h);var v=c.zoneSymbol("xhrTask");h.navigator&&h.navigator.geolocation&&c.patchPrototype(h.navigator.geolocation,["getCurrentPosition","watchPosition"])}).call(exports,function(){return this}())},function(e,exports){(function(e){(function(e){function t(e){return"__zone_symbol__"+e}function n(){D||T||0!=b.length||(e[g]?e[g].resolve(0)[k](a):e[y](a,0))}function r(e){n(),b.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(!_){for(_=!0;b.length;){var e=b;b=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){o(r)}}}for(;w.length;)for(var a=function(){var e=w.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};w.length;)a();_=!1,D=!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[E]===O)if(r instanceof M&&r[E]!==O)p(r),l(e,r[E],r[P]);else if(i(r))r.then(u(e,t),u(e,!1));else{e[E]=t;var o=e[P];e[P]=r;for(var a=0;a<o.length;)h(e,o[a++],o[a++],o[a++],o[a++]);if(0==o.length&&t==Z){e[E]=C;try{throw new Error("Uncaught (in promise): "+r)}catch(s){var c=s;c.rejection=r,c.promise=e,c.zone=f.current,c.task=f.currentTask,w.push(c),n()}}}return e}function p(e){if(e[E]===C){e[E]=Z;for(var t=0;t<w.length;t++)if(e===w[t].promise){w.splice(t,1);break}}}function h(e,t,n,r,o){p(e);var a=e[E]?r||s:o||c;t.scheduleMicroTask(S,function(){try{l(n,!0,t.run(a,null,[e[P]]))}catch(r){l(n,!1,r)}})}if(e.Zone)throw new Error("Zone already loaded.");var f=function(){function e(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new d(this,this._parent&&this._parent._zoneDelegate,t)}return Object.defineProperty(e,"current",{get:function(){return m},enumerable:!0,configurable:!0}),Object.defineProperty(e,"currentTask",{get:function(){return T},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},e.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},e.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},e.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)}},e.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var o=m;m=this;try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{m=o}},e.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var o=m;m=this;try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{m=o}},e.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=T;T=e;var o=m;m=this;try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{m=o,T=r}},e.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new v("microTask",this,e,t,n,r,null))},e.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new v("macroTask",this,e,t,n,r,o))},e.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new v("eventTask",this,e,t,n,r,o))},e.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},e.__symbol__=t,e}(),d=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 f(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}(),v=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(){try{return t.runTask(c,this,arguments)}finally{a()}}}return e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:this.toString()},e}(),y=t("setTimeout"),g=t("Promise"),k=t("then"),m=new f(null,null),T=null,b=[],_=!1,w=[],D=!1,E=t("state"),P=t("value"),S="Promise.then",O=null,z=!0,Z=!1,C=0,M=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[E]=O,n[P]=[];try{t&&t(u(n,z),u(n,Z))}catch(r){l(n,!1,r)}}return e.resolve=function(e){return l(new this(null),z,e)},e.reject=function(e){return l(new this(null),Z,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){r=e,o=t}),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){function t(e){o&&r(e),o=null}for(var n,r,o=new this(function(e,t){n=e,r=t}),a=0,s=[],c=0,u=e;c<u.length;c++){var l=u[c];i(l)||(l=this.resolve(l)),l.then(function(e){return function(t){s[e]=t,a--,o&&!a&&n(s)}}(a),t),a++}return a||n(s),o},e.prototype.then=function(e,t){var n=new this.constructor(null),r=f.current;return this[E]==O?this[P].push(r,n,e,t):h(this,r,n,e,t),n},e.prototype["catch"]=function(e){return this.then(null,e)},e}(),I=e[t("Promise")]=e.Promise;if(e.Promise=M,I){var j=I.prototype,L=j[t("then")]=j.then;j.then=function(e,t){var n=this;return new M(function(e,t){L.call(n,e,t)}).then(e,t)}}return Promise[f.__symbol__("uncaughtPromiseErrors")]=w,e.Zone=f})("undefined"==typeof window?e:window)}).call(exports,function(){return this}())},function(e,exports,t){"use strict";function n(e){var t=[],n=e.wtf;n?t=o.split(",").map(function(e){return"HTML"+e+"Element"}).concat(a):e[i]?t.push(i):t=a;for(var s=0;s<t.length;s++){var c=e[t[s]];r.patchEventTargetMethods(c&&c.prototype)}}var r=t(3),o="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",a="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".split(","),i="EventTarget";exports.eventTargetPatch=n},function(e,exports){(function(e){"use strict";function t(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 n(e,n){for(var r=e.constructor.name,o=function(o){var a=n[o],i=e[a];i&&(e[a]=function(e){return function(){return e.apply(this,t(arguments,r+"."+a))}}(i))},a=0;a<n.length;a++)o(a)}function r(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]},Object.defineProperty(e,t,n)}function o(e,t){var n=[];for(var o in e)"on"==o.substr(0,2)&&n.push(o);for(var a=0;a<n.length;a++)r(e,n[a]);if(t)for(var i=0;i<t.length;i++)r(e,"on"+t[i])}function a(e,t,n,r,o){var a=e[y];if(a)for(var i=0;i<a.length;i++){var s=a[i],c=s.data;if(c.handler===t&&c.useCapturing===r&&c.eventName===n)return o&&a.splice(i,1),s}return null}function i(e,t){var n=e[y];n||(n=e[y]=[]),n.push(t)}function s(e){var t=e.data;return i(t.target,e),t.target[m](t.eventName,e.invoke,t.useCapturing)}function c(e){var t=e.data;a(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.target[T](t.eventName,e.invoke,t.useCapturing)}function u(e,t){var n=t[0],r=t[1],o=t[2]||!1,i=e||v,u=null;"function"==typeof r?u=r:r&&r.handleEvent&&(u=function(e){return r.handleEvent(e)});var l=!1;try{l=r&&"[object FunctionWrapper]"===r.toString()}catch(p){return}if(!u||l)return i[m](n,r,o);var h=a(i,r,n,o,!1);if(h)return i[m](n,h.invoke,o);var f=Zone.current,d=i.constructor.name+".addEventListener:"+n,y={target:i,eventName:n,name:n,useCapturing:o,handler:r};f.scheduleEventTask(d,u,y,s,c)}function l(e,t){var n=t[0],r=t[1],o=t[2]||!1,i=e||v,s=a(i,r,n,o,!0);s?s.zone.cancelTask(s):i[T](n,r,o)}function p(e){return!(!e||!e.addEventListener)&&(d(e,g,function(){return u}),d(e,k,function(){return l}),!0)}function h(e){var n=v[e];if(n){v[e]=function(){var r=t(arguments,e);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"===e&&"responseBlob"===r||!function(t){"function"==typeof o[t]?v[e].prototype[t]=function(){return this[b][t].apply(this[b],arguments)}:Object.defineProperty(v[e].prototype,t,{set:function(n){"function"==typeof n?this[b][t]=Zone.current.wrap(n,e+"."+t):this[b][t]=n},get:function(){return this[b][t]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(v[e][r]=n[r])}}function f(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(n){return function(){return t(this,arguments)}}}function d(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=exports.zoneSymbol(t);return r&&!(o=r[a])&&(o=r[a]=r[t],r[t]=f(t,n(o,a,t))),o}exports.zoneSymbol=Zone.__symbol__;var v="undefined"==typeof window?e:window;exports.bindArguments=t,exports.patchPrototype=n,exports.isWebWorker="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,exports.isNode="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),exports.isBrowser=!exports.isNode&&!exports.isWebWorker&&!("undefined"==typeof window||!window.HTMLElement),exports.patchProperty=r,exports.patchOnProperties=o;var y=exports.zoneSymbol("eventTasks"),g="addEventListener",k="removeEventListener",m=exports.zoneSymbol(g),T=exports.zoneSymbol(k);exports.patchEventTargetMethods=p;var b=exports.zoneSymbol("originalInstance");exports.patchClass=h,exports.createNamedFn=f,exports.patchMethod=d}).call(exports,function(){return this}())},function(e,exports,t){"use strict";function n(){Object.defineProperty=function(e,t,n){if(o(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=a(e,t,n)),i(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]=a(e,n,t[n])}),l(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=u(e,t);return o(e,t)&&(n.configurable=!1),n}}function r(e,t,n){var r=n.configurable;return n=a(e,t,n),i(e,t,n,r)}function o(e,t){return e&&e[p]&&e[p][t]}function a(e,t,n){return n.configurable=!0,n.configurable||(e[p]||c(e,p,{writable:!0,value:{}}),e[p][t]=!0),n}function i(e,t,n,r){try{return c(e,t,n)}catch(o){if(n.configurable)return"undefined"==typeof r?delete n.configurable:n.configurable=r,c(e,t,n);throw o}}var s=t(3),c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l=Object.create,p=s.zoneSymbol("unconfigurables");exports.propertyPatch=n,exports._redefineProperty=r},function(e,exports,t){"use strict";function n(e){if(o.isBrowser&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,o){return o&&o.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(o.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(o.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),r._redefineProperty(o.prototype,e,n)):o.prototype[e]=Zone.current.wrap(o.prototype[e],t)}else o.prototype[e]&&(o.prototype[e]=Zone.current.wrap(o.prototype[e],t))}),t.apply(document,[e,o])}}}var r=t(4),o=t(3);exports.registerElementPatch=n},function(e,exports,t){"use strict";function n(e){if(!i.isNode){var t="undefined"!=typeof WebSocket;r()?(i.isBrowser&&i.patchOnProperties(HTMLElement.prototype,s),i.patchOnProperties(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(i.patchOnProperties(IDBIndex.prototype,null),i.patchOnProperties(IDBRequest.prototype,null),i.patchOnProperties(IDBOpenDBRequest.prototype,null),i.patchOnProperties(IDBDatabase.prototype,null),i.patchOnProperties(IDBTransaction.prototype,null),i.patchOnProperties(IDBCursor.prototype,null)),t&&i.patchOnProperties(WebSocket.prototype,null)):(o(),i.patchClass("XMLHttpRequest"),t&&a.apply(e))}}function r(){if(i.isBrowser&&!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=s[e],n="on"+t;document.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][c]&&(t=Zone.current.wrap(o[n],r),t[c]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<s.length;t++)e(t)}var a=t(7),i=t(3),s="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(" ");exports.propertyDescriptorPatch=n;var c=i.zoneSymbol("unbound")},function(e,exports,t){"use strict";function n(e){var t=e.WebSocket;e.EventTarget||r.patchEventTargetMethods(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.patchOnProperties(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}var r=t(3);exports.apply=n},function(e,exports,t){"use strict";function n(e,t,n,o){function a(t){var n=t.data;return n.args[0]=t.invoke,n.handleId=s.apply(e,n.args),t}function i(e){return c(e.data.handleId)}var s=null,c=null;t+=o,n+=o,s=r.patchMethod(e,t,function(n){return function(r,s){if("function"==typeof s[0]){var c=Zone.current,u={handleId:null,isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:null,args:s},l=c.scheduleMacroTask(t,s[0],u,a,i);if(!l)return l;var p=l.data.handleId;return p.ref&&p.unref&&(l.ref=p.ref.bind(p),l.unref=p.unref.bind(p)),l}return n.apply(e,s)}}),c=r.patchMethod(e,n,function(t){return function(n,r){var o=r[0];o&&"string"==typeof o.type?(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}var r=t(3);exports.patchTimer=n}]);

@@ -17,3 +17,3 @@ import '../zone';

patchTimer(_global, set, clear, 'Immediate');
patchTimer(_global, 'request', 'cancelMacroTask', 'AnimationFrame');
patchTimer(_global, 'request', 'cancel', 'AnimationFrame');
patchTimer(_global, 'mozRequest', 'mozCancel', 'AnimationFrame');

@@ -20,0 +20,0 @@ patchTimer(_global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');

@@ -17,6 +17,7 @@ import {zoneSymbol} from "../common/utils";

}
const originalConfigurableFlag = desc.configurable;
if (prop !== 'prototype') {
desc = rewriteDescriptor(obj, prop, desc);
}
return _defineProperty(obj, prop, desc);
return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);
};

@@ -32,3 +33,3 @@

Object.create = function (obj, proto) {
if (typeof proto === 'object') {
if (typeof proto === 'object' && !Object.isFrozen(proto)) {
Object.keys(proto).forEach(function (prop) {

@@ -51,4 +52,5 @@ proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);

export function _redefineProperty(obj, prop, desc) {
const originalConfigurableFlag = desc.configurable;
desc = rewriteDescriptor(obj, prop, desc);
return _defineProperty(obj, prop, desc);
return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);
};

@@ -71,2 +73,21 @@

function _tryDefineProperty (obj, prop, desc, originalConfigurableFlag) {
try {
return _defineProperty(obj, prop, desc);
}
catch(e) {
if (desc.configurable) {
// In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's retry with the original flag value
if (typeof originalConfigurableFlag == 'undefined') {
delete desc.configurable;
} else {
desc.configurable = originalConfigurableFlag;
}
return _defineProperty(obj, prop, desc);
} else {
throw e;
}
}
}
import {patchEventTargetMethods} from '../common/utils';
const WTF_ISSUE_555 = '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';
const NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex'.split(',');
const NO_EVENT_TARGET = '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'.split(',');
const EVENT_TARGET = 'EventTarget';

@@ -6,0 +6,0 @@

@@ -39,3 +39,13 @@ import {patchMethod} from './utils';

};
return zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);
var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask) ;
if (!task) {
return task;
}
// Node.js must additionally support the ref and unref functions.
var handle = (<TimerOptions>task.data).handleId;
if ((<any>handle).ref && (<any>handle).unref) {
(<any>task).ref = (<any>handle).ref.bind(handle);
(<any>task).unref = (<any>handle).unref.bind(handle);
}
return task;
} else {

@@ -42,0 +52,0 @@ // cause an error by calling it directly.

@@ -263,2 +263,4 @@ /**

for (prop in instance) {
// https://bugs.webkit.org/show_bug.cgi?id=44721
if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue;
(function (prop) {

@@ -265,0 +267,0 @@ if (typeof instance[prop] === 'function') {

@@ -7,7 +7,2 @@ 'use strict';

}
const SET_TIMEOUT = '__zone_symbol__setTimeout';
const _global = typeof window == 'undefined' ? global : window;
// When you have in async test (test with `done` argument) jasmine will

@@ -21,6 +16,10 @@ // execute the next test synchronously in the done handler. This makes sense

(<any>jasmine).QueueRunner = (function (SuperQueueRunner) {
const originalZone = Zone.current;
// Subclass the `QueueRunner` and override the `clearStack` method.
function alwaysClearStack(fn) {
_global[SET_TIMEOUT](fn, 0);
const zone: Zone = Zone.current.getZoneWith('JasmineClearStackZone')
|| Zone.current.getZoneWith('ProxyZoneSpec')
|| originalZone;
zone.scheduleMicroTask('jasmineCleanStack', fn);
}

@@ -27,0 +26,0 @@

@@ -50,3 +50,3 @@ (function() {

if (result) {
this._failCallback(error.message ? error.message : 'unknown error');
this._failCallback(error);
this._alreadyErrored = true;

@@ -53,0 +53,0 @@ }

@@ -83,2 +83,3 @@ (function() {

private _lastError: Error = null;
private _uncaughtPromiseErrors: {rejection: any}[] = Promise[Zone['__symbol__']('uncaughtPromiseErrors')];

@@ -176,3 +177,4 @@ pendingPeriodicTimers: number[] = [];

private _resetLastErrorAndThrow(): void {
let error = this._lastError;
let error = this._lastError || this._uncaughtPromiseErrors[0];
this._uncaughtPromiseErrors.length = 0;
this._lastError = null;

@@ -193,6 +195,4 @@ throw error;

FakeAsyncTestZoneSpec.assertInZone();
while (this._microtasks.length > 0) {
let microtask = this._microtasks.shift();
microtask();
if (this._lastError !== null) {
const flushErrors = () => {
if (this._lastError !== null || this._uncaughtPromiseErrors.length) {
// If there is an error stop processing the microtask queue and rethrow the error.

@@ -202,2 +202,7 @@ this._resetLastErrorAndThrow();

}
while (this._microtasks.length > 0) {
let microtask = this._microtasks.shift();
microtask();
}
flushErrors();
}

@@ -204,0 +209,0 @@

@@ -137,9 +137,18 @@ /**

* If the current zone does not have a key, the request is delegated to the parent zone. Use
* [ZoneSpec.properties] to configure the set of properties asseciated with the current zone.
* [ZoneSpec.properties] to configure the set of properties associated with the current zone.
*
* @param key The key to retrieve.
* @returns {any} Tha value for the key, or `undefined` if not found.
* @returns {any} The value for the key, or `undefined` if not found.
*/
get(key: string): any;
/**
* Returns a Zone which defines a `key`.
*
* Recursively search the parent Zone until a Zone which has a property `key` is found.
*
* @param key The key to use for identification of the returned zone.
* @returns {Zone} The Zone which defines the `key`, `null` if not found.
*/
getZoneWith(key: string): Zone;
/**
* Used to create a child zone.

@@ -399,2 +408,7 @@ *

delay?: number;
/**
* identifier returned by the native setTimeout.
*/
handleId?: number;
}

@@ -491,3 +505,6 @@

const Zone: ZoneType = (function(global) {
const Zone: ZoneType = (function(global: any) {
if (global.Zone) {
throw new Error('Zone already loaded.');
}
class Zone implements AmbientZone {

@@ -518,9 +535,15 @@ static __symbol__: (name: string) => string = __symbol__;

public get(key: string): any {
const zone: Zone = this.getZoneWith(key) as Zone;
if (zone) return zone._properties[key];
}
public getZoneWith(key: string): AmbientZone {
let current: Zone = this;
while (current) {
if (current._properties.hasOwnProperty(key)) {
return current._properties[key];
return current;
}
current = current._parent;
}
return null;
}

@@ -826,2 +849,10 @@

}
public toString() {
if (this.data && typeof this.data.handleId !== 'undefined') {
return this.data.handleId;
} else {
return this.toString();
}
}
}

@@ -845,3 +876,3 @@

let _isDrainingMicrotaskQueue: boolean = false;
let _uncaughtPromiseErrors: UncaughtPromiseError[] = [];
const _uncaughtPromiseErrors: UncaughtPromiseError[] = [];
let _drainScheduled: boolean = false;

@@ -872,3 +903,4 @@

'; Task:', e.task && (<Task>e.task).source,
'; Value:', rejection
'; Value:', rejection,
rejection instanceof Error ? rejection.stack : undefined
);

@@ -895,6 +927,4 @@ }

while(_uncaughtPromiseErrors.length) {
const uncaughtPromiseErrors = _uncaughtPromiseErrors;
_uncaughtPromiseErrors = [];
for (let i = 0; i < uncaughtPromiseErrors.length; i++) {
const uncaughtPromiseError: UncaughtPromiseError = uncaughtPromiseErrors[i];
while(_uncaughtPromiseErrors.length) {
const uncaughtPromiseError: UncaughtPromiseError = _uncaughtPromiseErrors.shift();
try {

@@ -1055,2 +1085,5 @@ uncaughtPromiseError.zone.runGuarded(() => { throw uncaughtPromiseError; });

const promise: ZoneAwarePromise<R> = this;
if (!(promise instanceof ZoneAwarePromise)) {
throw new Error('Must be an instanceof Promise.');
}
promise[symbolState] = UNRESOLVED;

@@ -1068,3 +1101,3 @@ promise[symbolValue] = []; // queue;

{
const chainPromise: Promise<R> = new ZoneAwarePromise(null);
const chainPromise: Promise<R> = new (this.constructor as typeof ZoneAwarePromise)(null);
const zone = Zone.current;

@@ -1098,3 +1131,5 @@ if (this[symbolState] == UNRESOLVED ) {

// This is not part of public API, but it is usefull for tests, so we expose it.
Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
return global.Zone = Zone;
})(typeof window === 'undefined' ? global : window);
{
"name": "zone.js",
"version": "0.6.12",
"version": "0.6.13",
"description": "Zones for JavaScript",

@@ -5,0 +5,0 @@ "main": "dist/zone-node.js",

@@ -7,2 +7,5 @@ # Zone.js

> If you're using zone.js via npmcdn please provide a query param `?main=browser`
`https://npmcdn.com/zone.js?main=browser`
# NEW Zone.js POST-v0.6.0

@@ -29,11 +32,11 @@

```javascript
zone.fork().run(function () {
zone.inTheZone = true;
Zone.current.fork({}).run(function () {
Zone.current.inTheZone = true;
setTimeout(function () {
console.log('in the zone: ' + !!zone.inTheZone);
}, 0);
setTimeout(function () {
console.log('in the zone: ' + !!Zone.current.inTheZone);
}, 0);
});
console.log('in the zone: ' + !!zone.inTheZone);
console.log('in the zone: ' + !!Zone.current.inTheZone);
```

@@ -40,0 +43,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc