UNPKG

zone.js

Version:
1 lines 2.36 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";var e=function(){function e(e){void 0===e&&(e=null),this.defaultSpecDelegate=e,this.name="ProxyZone",this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.setDelegate(e)}return e.get=function(){return Zone.current.get("ProxyZoneSpec")},e.isLoaded=function(){return e.get()instanceof e},e.assertPresent=function(){if(!this.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return e.get()},e.prototype.setDelegate=function(e){var t=this;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach(function(e){return delete t.properties[e]}),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach(function(n){return t.properties[n]=e.properties[n]}))},e.prototype.getDelegate=function(){return this._delegateSpec},e.prototype.resetDelegate=function(){this.setDelegate(this.defaultSpecDelegate)},e.prototype.onFork=function(e,t,n,o){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,n,o):e.fork(n,o)},e.prototype.onIntercept=function(e,t,n,o,r){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,n,o,r):e.intercept(n,o,r)},e.prototype.onInvoke=function(e,t,n,o,r,s,p){return this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,n,o,r,s,p):e.invoke(n,o,r,s,p)},e.prototype.onHandleError=function(e,t,n,o){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,n,o):e.handleError(n,o)},e.prototype.onScheduleTask=function(e,t,n,o){return this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,n,o):e.scheduleTask(n,o)},e.prototype.onInvokeTask=function(e,t,n,o,r,s){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onInvokeTask(e,t,n,o,r,s):e.invokeTask(n,o,r,s)},e.prototype.onCancelTask=function(e,t,n,o){return this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,n,o):e.cancelTask(n,o)},e.prototype.onHasTask=function(e,t,n,o){this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,n,o):e.hasTask(n,o)},e}();Zone.ProxyZoneSpec=e});