From 0f369ab7a44fa18443cb186989a681633534a07c Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Fri, 11 Sep 2015 09:06:24 -0700 Subject: [PATCH] 0.5.5 --- dist/jasmine-patch.min.js | 2 +- dist/long-stack-trace-zone.js | 2 +- dist/long-stack-trace-zone.min.js | 2 +- dist/zone-microtask.js | 222 ++++++++++++++++++++---------- dist/zone-microtask.min.js | 2 +- dist/zone.js | 201 +++++++++++++++++++-------- dist/zone.min.js | 2 +- package.json | 2 +- 8 files changed, 294 insertions(+), 141 deletions(-) diff --git a/dist/jasmine-patch.min.js b/dist/jasmine-patch.min.js index 93659f4b0..03df43043 100644 --- a/dist/jasmine-patch.min.js +++ b/dist/jasmine-patch.min.js @@ -1 +1 @@ -!function n(e,o,t){function r(f,u){if(!o[f]){if(!e[f]){var c="function"==typeof require&&require;if(!u&&c)return c(f,!0);if(i)return i(f,!0);var a=new Error("Cannot find module '"+f+"'");throw a.code="MODULE_NOT_FOUND",a}var l=o[f]={exports:{}};e[f][0].call(l.exports,function(n){var o=e[f][1][n];return r(o?o:n)},l,l.exports,n,e,o,t)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f= 0; i--) { if (typeof args[i] === 'function') { @@ -949,7 +1018,6 @@ function patchProperty(obj, prop) { }; function patchProperties(obj, properties) { - (properties || (function () { var props = []; for (var prop in obj) { @@ -965,9 +1033,14 @@ function patchProperties(obj, properties) { }); }; +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + function patchEventTargetMethods(obj) { - var addDelegate = obj.addEventListener; - obj.addEventListener = function (eventName, handler) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); var fn; //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 if (handler.toString() !== "[object FunctionWrapper]") { @@ -981,29 +1054,35 @@ function patchEventTargetMethods(obj) { })(handler); } else { fn = handler; - } + } - handler._fn = fn; - handler._bound = handler._bound || {}; - arguments[1] = handler._bound[eventName] = zone.bind(fn); + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; } - return addDelegate.apply(this, arguments); + + return global.zone.addEventListener.apply(this, arguments); }; - var removeDelegate = obj.removeEventListener; - obj.removeEventListener = function (eventName, handler) { - if(handler._bound && handler._bound[eventName]) { - var _bound = handler._bound; + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; - arguments[1] = _bound[eventName]; - delete _bound[eventName]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; } - var result = removeDelegate.apply(this, arguments); - global.zone.dequeueTask(handler._fn); + var result = global.zone.removeEventListener.apply(this, arguments); + global.zone.dequeueTask(handler[originalFnKey]); return result; }; }; +var originalInstanceKey = keys.create('originalInstance'); + // wrap some native API on `window` function patchClass(className) { var OriginalClass = global[className]; @@ -1012,11 +1091,11 @@ function patchClass(className) { global[className] = function () { var a = bindArguments(arguments); switch (a.length) { - case 0: this._o = new OriginalClass(); break; - case 1: this._o = new OriginalClass(a[0]); break; - case 2: this._o = new OriginalClass(a[0], a[1]); break; - case 3: this._o = new OriginalClass(a[0], a[1], a[2]); break; - case 4: this._o = new OriginalClass(a[0], a[1], a[2], a[3]); break; + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; default: throw new Error('what are you even doing?'); } }; @@ -1028,19 +1107,19 @@ function patchClass(className) { (function (prop) { if (typeof instance[prop] === 'function') { global[className].prototype[prop] = function () { - return this._o[prop].apply(this._o, arguments); + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); }; } else { Object.defineProperty(global[className].prototype, prop, { set: function (fn) { if (typeof fn === 'function') { - this._o[prop] = global.zone.bind(fn); + this[originalInstanceKey][prop] = global.zone.bind(fn); } else { - this._o[prop] = fn; + this[originalInstanceKey][prop] = fn; } }, get: function () { - return this._o[prop]; + return this[originalInstanceKey][prop]; } }); } @@ -1066,14 +1145,14 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],15:[function(require,module,exports){ +},{"./keys":3}],17:[function(require,module,exports){ (function (process,global){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE - * @version 2.3.0 + * @version 3.0.2 */ (function() { @@ -1141,15 +1220,10 @@ module.exports = { // node function lib$es6$promise$asap$$useNextTick() { - var nextTick = process.nextTick; // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // setImmediate should be used instead instead - var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); - if (Array.isArray(version) && version[1] === '0' && version[2] === '10') { - nextTick = setImmediate; - } + // see https://github.com/cujojs/when/issues/410 for details return function() { - nextTick(lib$es6$promise$asap$$flush); + process.nextTick(lib$es6$promise$asap$$flush); }; } @@ -1201,7 +1275,7 @@ module.exports = { lib$es6$promise$asap$$len = 0; } - function lib$es6$promise$asap$$attemptVertex() { + function lib$es6$promise$asap$$attemptVertx() { try { var r = require; var vertx = r('vertx'); @@ -1221,7 +1295,7 @@ module.exports = { } else if (lib$es6$promise$asap$$isWorker) { lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel(); } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') { - lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertex(); + lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx(); } else { lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout(); } @@ -1234,7 +1308,7 @@ module.exports = { var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject(); - function lib$es6$promise$$internal$$selfFullfillment() { + function lib$es6$promise$$internal$$selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); } @@ -1318,7 +1392,7 @@ module.exports = { function lib$es6$promise$$internal$$resolve(promise, value) { if (promise === value) { - lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment()); + lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment()); } else if (lib$es6$promise$utils$$objectOrFunction(value)) { lib$es6$promise$$internal$$handleMaybeThenable(promise, value); } else { diff --git a/dist/zone-microtask.min.js b/dist/zone-microtask.min.js index f49168b3a..bf38b1c9e 100644 --- a/dist/zone-microtask.min.js +++ b/dist/zone-microtask.min.js @@ -1 +1 @@ -!function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u-1;if(u&&!a){var s=Promise.resolve();i._setScheduler(function(e){s.then(e)})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":15}],4:[function(e,t,n){(function(n){"use strict";function r(){o.patchSetClearFunction(n,["timeout","interval","immediate"]),o.patchRequestAnimationFrame(n,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame"]),o.patchFunction(n,["alert","prompt"]),c.apply(),f.apply(),i.apply(),u.patchClass("MutationObserver"),u.patchClass("WebKitMutationObserver"),a.apply(),s.apply(),p.apply()}var o=e("./functions"),i=e("./promise"),u=e("./mutation-observer"),a=e("./define-property"),s=e("./register-element"),c=(e("./websocket"),e("./event-target")),f=e("./property-descriptor"),p=e("./geolocation");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./define-property":5,"./event-target":6,"./functions":7,"./geolocation":8,"./mutation-observer":9,"./promise":10,"./property-descriptor":11,"./register-element":12,"./websocket":13}],5:[function(e,t,n){"use strict";function r(){Object.defineProperty=function(e,t,n){if(i(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);return"prototype"!==t&&(n=u(e,t,n)),a(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]=u(e,n,t[n])}),c(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=s(e,t);return i(e,t)&&(n.configurable=!1),n}}function o(e,t,n){return n=u(e,t,n),a(e,t,n)}function i(e,t){return e&&e.__unconfigurables&&e.__unconfigurables[t]}function u(e,t,n){return n.configurable=!0,n.configurable||(e.__unconfigurables||a(e,"__unconfigurables",{writable:!0,value:{}}),e.__unconfigurables[t]=!0),n}var a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.create;t.exports={apply:r,_redefineProperty:o}},{}],6:[function(e,t,n){(function(n){"use strict";function r(){if(n.EventTarget)o.patchEventTargetMethods(n.EventTarget.prototype);else{var e=["ApplicationCache","EventSource","FileReader","InputMethodContext","MediaController","MessagePort","Node","Performance","SVGElementInstance","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebKitNamedFlow","Window","Worker","WorkerGlobalScope","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];e.forEach(function(e){n[e]&&o.patchEventTargetMethods(n[e].prototype)})}}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14}],7:[function(e,t,n){(function(n){"use strict";function r(e,t){t.map(function(e){return e[0].toUpperCase()+e.substr(1)}).forEach(function(t){var r="set"+t,o=e[r];if(o){var i="clear"+t,u={},s="setInterval"===r?a.bindArguments:a.bindArgumentsOnce;n.zone[r]=function(t){var n,r=t;arguments[0]=function(){return delete u[n],r.apply(this,arguments)};var i=s(arguments);return n=o.apply(e,i),u[n]=!0,n},e[r]=function(){return n.zone[r].apply(this,arguments)};var c=e[i];n.zone[i]=function(e){return u[e]&&(delete u[e],n.zone.dequeueTask()),c.apply(this,arguments)},e[i]=function(){return n.zone[i].apply(this,arguments)}}})}function o(e,t){t.forEach(function(t){var r=e[t];r&&(n.zone[t]=function(t){var o=n.zone.isRootZone()?n.zone.fork():n.zone;return t&&(arguments[0]=function(){return o.run(t,arguments)}),r.apply(e,arguments)},e[t]=function(){return n.zone[t].apply(this,arguments)})})}function i(e,t){t.forEach(function(t){var r=e[t];r&&(n.zone[t]=function(t){var n=t;arguments[0]=function(){return n.apply(this,arguments)};var o=a.bindArgumentsOnce(arguments);return r.apply(e,o)},e[t]=function(){return zone[t].apply(this,arguments)})})}function u(e,t){t.forEach(function(t){var r=e[t];n.zone[t]=function(){return r.apply(e,arguments)},e[t]=function(){return n.zone[t].apply(this,arguments)}})}var a=e("../utils");t.exports={patchSetClearFunction:r,patchSetFunction:i,patchRequestAnimationFrame:o,patchFunction:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14}],8:[function(e,t,n){(function(n){"use strict";function r(){n.navigator&&n.navigator.geolocation&&o.patchPrototype(n.navigator.geolocation,["getCurrentPosition","watchPosition"])}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14}],9:[function(e,t,n){(function(e){"use strict";function n(t){var n=e[t];if(n){e[t]=function(t){this._o=new n(e.zone.bind(t,!0)),this._creationZone=e.zone};var r=new n(function(){});e[t].prototype.disconnect=function(){var e=this._o.disconnect.apply(this._o,arguments);return this._active&&(this._creationZone.dequeueTask(),this._active=!1),e},e[t].prototype.observe=function(){return this._active||(this._creationZone.enqueueTask(),this._active=!0),this._o.observe.apply(this._o,arguments)};var o;for(o in r)!function(n){void 0===typeof e[t].prototype&&("function"==typeof r[n]?e[t].prototype[n]=function(){return this._o[n].apply(this._o,arguments)}:Object.defineProperty(e[t].prototype,n,{set:function(t){this._o[n]="function"==typeof t?e.zone.bind(t):t},get:function(){return this._o[n]}}))}(o)}}t.exports={patchClass:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,n){(function(n){"use strict";function r(e,t){var r=n,o=e.every(function(e){return r=r[e]});o&&t.forEach(function(e){var t=r[e];t&&(r[e]=u(t))})}function o(e){var t=e.then;e.then=function(){var n=a.bindArguments(arguments),r=t.apply(e,n);return o(r)};var n=e["catch"];return e["catch"]=function(){var t=a.bindArguments(arguments),r=n.apply(e,t);return o(r)},e}function i(){if(n.Promise){a.patchPrototype(Promise.prototype,["then","catch"]);var e=[[[],["fetch"]],[["Response","prototype"],["arrayBuffer","blob","json","text"]]];e.forEach(function(e){r(e[0],e[1])})}}var u,a=e("../utils");u=n.Promise?function(e){return function(){var t=e.apply(this,arguments);return t instanceof Promise?t:new Promise(function(e,n){t.then(e,n)})}}:function(e){return function(){return o(e.apply(this,arguments))}},t.exports={apply:i,bindPromiseFn:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14}],11:[function(e,t,n){(function(n){"use strict";function r(){if(!a.isWebWorker()){var e="undefined"!=typeof WebSocket;if(o()){var t=s.map(function(e){return"on"+e});a.patchProperties(HTMLElement.prototype,t),a.patchProperties(XMLHttpRequest.prototype),e&&a.patchProperties(WebSocket.prototype)}else i(),a.patchClass("XMLHttpRequest"),e&&u.apply()}}function o(){if(!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(HTMLElement.prototype,"onclick",{get:function(){return!0}});var t=document.createElement("div"),n=!!t.onclick;return Object.defineProperty(HTMLElement.prototype,"onclick",{}),n}function i(){s.forEach(function(e){var t="on"+e;document.addEventListener(e,function(e){for(var r,o=e.target;o;)o[t]&&!o[t]._unbound&&(r=n.zone.bind(o[t]),r._unbound=o[t],o[t]=r),o=o.parentElement},!0)})}var u=e("./websocket"),a=e("../utils"),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(" ");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14,"./websocket":13}],12:[function(e,t,n){(function(n){"use strict";function r(){if(!i.isWebWorker()&&"registerElement"in n.document){var e=document.registerElement,t=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(r,i){return i&&i.prototype&&t.forEach(function(e){if(i.prototype.hasOwnProperty(e)){var t=Object.getOwnPropertyDescriptor(i.prototype,e);t&&t.value?(t.value=n.zone.bind(t.value),o(i.prototype,e,t)):i.prototype[e]=n.zone.bind(i.prototype[e])}else i.prototype[e]&&(i.prototype[e]=n.zone.bind(i.prototype[e]))}),e.apply(document,[r,i])}}}var o=e("./define-property")._redefineProperty,i=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14,"./define-property":5}],13:[function(e,t,n){(function(n){"use strict";function r(){var e=n.WebSocket;o.patchEventTargetMethods(e.prototype),n.WebSocket=function(t,n){var r,i=arguments.length>1?new e(t,n):new e(t),u=Object.getOwnPropertyDescriptor(i,"onmessage");return u&&u.configurable===!1?(r=Object.create(i),["addEventListener","removeEventListener","send","close"].forEach(function(e){r[e]=function(){return i[e].apply(i,arguments)}})):r=i,o.patchProperties(r,["onclose","onerror","onmessage","onopen"]),r}}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":14}],14:[function(e,t,n){(function(e){"use strict";function n(t){for(var n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=e.zone.bind(t[n]));return t}function r(t){for(var n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=e.zone.bindOnce(t[n]));return t}function o(e,t){t.forEach(function(t){var r=e[t];r&&(e[t]=function(){return r.apply(this,n(arguments))})})}function i(){return"undefined"==typeof document}function u(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){this[o]&&this.removeEventListener(r,this[o]),"function"==typeof e?(this[o]=e,this.addEventListener(r,e,!1)):this[o]=null},n.get=function(){return this[o]},Object.defineProperty(e,t,n)}function a(e,t){(t||function(){var t=[];for(var n in e)t.push(n);return t}().filter(function(e){return"on"===e.substr(0,2)})).forEach(function(t){u(e,t)})}function s(t){var n=t.addEventListener;t.addEventListener=function(e,t){var r;return"[object FunctionWrapper]"!==t.toString()&&(r=t.handleEvent?function(e){return function(){e.handleEvent.apply(e,arguments)}}(t):t,t._fn=r,t._bound=t._bound||{},arguments[1]=t._bound[e]=zone.bind(r)),n.apply(this,arguments)};var r=t.removeEventListener;t.removeEventListener=function(t,n){if(n._bound&&n._bound[t]){var o=n._bound;arguments[1]=o[t],delete o[t]}var i=r.apply(this,arguments);return e.zone.dequeueTask(n._fn),i}}function c(t){var r=e[t];if(r){e[t]=function(){var e=n(arguments);switch(e.length){case 0:this._o=new r;break;case 1:this._o=new r(e[0]);break;case 2:this._o=new r(e[0],e[1]);break;case 3:this._o=new r(e[0],e[1],e[2]);break;case 4:this._o=new r(e[0],e[1],e[2],e[3]);break;default:throw new Error("what are you even doing?")}};var o,i=new r;for(o in i)!function(n){"function"==typeof i[n]?e[t].prototype[n]=function(){return this._o[n].apply(this._o,arguments)}:Object.defineProperty(e[t].prototype,n,{set:function(t){this._o[n]="function"==typeof t?e.zone.bind(t):t},get:function(){return this._o[n]}})}(o);for(o in r)"prototype"!==o&&r.hasOwnProperty(o)&&(e[t][o]=r[o])}}t.exports={bindArguments:n,bindArgumentsOnce:r,patchPrototype:o,patchProperty:u,patchProperties:a,patchEventTargetMethods:s,patchClass:c,isWebWorker:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t,n){(function(n,r){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function a(e){X=e}function s(e){G=e}function c(){var e=n.nextTick,t=n.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(t)&&"0"===t[1]&&"10"===t[2]&&(e=setImmediate),function(){e(h)}}function f(){return function(){U(h)}}function p(){var e=0,t=new V(h),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(h,1)}}function h(){for(var e=0;$>e;e+=2){var t=te[e],n=te[e+1];t(n),te[e]=void 0,te[e+1]=void 0}$=0}function y(){try{var t=e,n=t("vertx");return U=n.runOnLoop||n.runOnContext,f()}catch(r){return d()}}function v(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function b(e){try{return e.then}catch(t){return ie.error=t,ie}}function w(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function _(e,t,n){G(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?P(e,n):j(e,n))},function(t){r||(r=!0,x(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,x(e,o))},e)}function k(e,t){t._state===re?j(e,t._result):t._state===oe?x(e,t._result):T(t,void 0,function(t){P(e,t)},function(t){x(e,t)})}function E(e,t){if(t.constructor===e.constructor)k(e,t);else{var n=b(t);n===ie?x(e,ie.error):void 0===n?j(e,t):i(n)?_(e,t,n):j(e,t)}}function P(e,t){e===t?x(e,g()):o(t)?E(e,t):j(e,t)}function O(e){e._onerror&&e._onerror(e._result),z(e)}function j(e,t){e._state===ne&&(e._result=t,e._state=re,0!==e._subscribers.length&&G(z,e))}function x(e,t){e._state===ne&&(e._state=oe,e._result=t,G(O,e))}function T(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+re]=n,o[i+oe]=r,0===i&&e._state&&G(z,e)}function z(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,u=0;uu;u++)T(r.resolve(e[u]),void 0,t,n);return o}function W(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(v);return P(n,e),n}function R(e){var t=this,n=new t(v);return x(n,e),n}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(e){this._id=le++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&(i(e)||Z(),this instanceof H||D(),S(this,e))}function I(){var e;if("undefined"!=typeof r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=de)}var N;N=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var U,X,K,Y=N,$=0,G=({}.toString,function(e,t){te[$]=e,te[$+1]=t,$+=2,2===$&&(X?X(h):K())}),J="undefined"!=typeof window?window:void 0,B=J||{},V=B.MutationObserver||B.WebKitMutationObserver,Q="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),ee="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);K=Q?c():V?p():ee?l():void 0===J&&"function"==typeof e?y():d();var ne=void 0,re=1,oe=2,ie=new A,ue=new A;q.prototype._validateInput=function(e){return Y(e)},q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},q.prototype._init=function(){this._result=new Array(this.length)};var ae=q;q.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===ne&&t>o;o++)e._eachEntry(r[o],o)},q.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;u(e)?e.constructor===r&&e._state!==ne?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},q.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===ne&&(r._remaining--,e===oe?x(o,n):r._result[t]=n),0===r._remaining&&j(o,r._result)},q.prototype._willSettleAt=function(e,t){var n=this;T(e,void 0,function(e){n._settledAt(re,t,e)},function(e){n._settledAt(oe,t,e)})};var se=L,ce=F,fe=W,pe=R,le=0,de=H;H.all=se,H.race=ce,H.resolve=fe,H.reject=pe,H._setScheduler=a,H._setAsap=s,H._asap=G,H.prototype={constructor:H,then:function(e,t){var n=this,r=n._state;if(r===re&&!e||r===oe&&!t)return this;var o=new this.constructor(v),i=n._result;if(r){var u=arguments[r-1];G(function(){M(r,o,u,i)})}else T(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var he=I,ye={Promise:de,polyfill:he};"function"==typeof define&&define.amd?define(function(){return ye}):"undefined"!=typeof t&&t.exports?t.exports=ye:"undefined"!=typeof this&&(this.ES6Promise=ye),he()}).call(this)}).call(this,{},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file +!function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u-1;if(u&&!a){var s=Promise.resolve();i._setScheduler(function(e){s.then(e)})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":17}],5:[function(e,t,n){(function(n){"use strict";function r(){o.patchSetClearFunction(n,["timeout","interval","immediate"]),o.patchRequestAnimationFrame(n,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame"]),o.patchFunction(n,["alert","prompt"]),c.apply(),f.apply(),i.apply(),u.patchClass("MutationObserver"),u.patchClass("WebKitMutationObserver"),a.apply(),s.apply(),p.apply(),l.apply()}var o=e("./functions"),i=e("./promise"),u=e("./mutation-observer"),a=e("./define-property"),s=e("./register-element"),c=(e("./websocket"),e("./event-target")),f=e("./property-descriptor"),p=e("./geolocation"),l=e("./file-reader");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(e,t,n){"use strict";function r(){Object.defineProperty=function(e,t,n){if(i(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);return"prototype"!==t&&(n=u(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]=u(e,n,t[n])}),f(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=c(e,t);return i(e,t)&&(n.configurable=!1),n}}function o(e,t,n){return n=u(e,t,n),s(e,t,n)}function i(e,t){return e&&e[p]&&e[p][t]}function u(e,t,n){return n.configurable=!0,n.configurable||(e[p]||s(e,p,{writable:!0,value:{}}),e[p][t]=!0),n}var a=e("../keys"),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f=Object.create,p=a.create("unconfigurables");t.exports={apply:r,_redefineProperty:o}},{"../keys":3}],7:[function(e,t,n){(function(n){"use strict";function r(){if(n.EventTarget)o.patchEventTargetMethods(n.EventTarget.prototype);else{var e=["ApplicationCache","EventSource","FileReader","InputMethodContext","MediaController","MessagePort","Node","Performance","SVGElementInstance","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebKitNamedFlow","Window","Worker","WorkerGlobalScope","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];e.forEach(function(e){var t=n[e]&&n[e].prototype;t&&t.addEventListener&&o.patchEventTargetMethods(t)})}}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],8:[function(e,t,n){"use strict";function r(){o.patchClass("FileReader")}var o=e("../utils");t.exports={apply:r}},{"../utils":16}],9:[function(e,t,n){(function(n){"use strict";function r(e,t){t.map(function(e){return e[0].toUpperCase()+e.substr(1)}).forEach(function(t){var r="set"+t,o=e[r];if(o){var i="clear"+t,u={},s="setInterval"===r?a.bindArguments:a.bindArgumentsOnce;n.zone[r]=function(t){var n,r=t;arguments[0]=function(){return delete u[n],r.apply(this,arguments)};var i=s(arguments);return n=o.apply(e,i),u[n]=!0,n},e[r]=function(){return n.zone[r].apply(this,arguments)};var c=e[i];n.zone[i]=function(e){return u[e]&&(delete u[e],n.zone.dequeueTask()),c.apply(this,arguments)},e[i]=function(){return n.zone[i].apply(this,arguments)}}})}function o(e,t){t.forEach(function(t){var r=e[t];r&&(n.zone[t]=function(t){var o=n.zone.isRootZone()?n.zone.fork():n.zone;return t&&(arguments[0]=function(){return o.run(t,arguments)}),r.apply(e,arguments)},e[t]=function(){return n.zone[t].apply(this,arguments)})})}function i(e,t){t.forEach(function(t){var r=e[t];r&&(n.zone[t]=function(t){var n=t;arguments[0]=function(){return n.apply(this,arguments)};var o=a.bindArgumentsOnce(arguments);return r.apply(e,o)},e[t]=function(){return zone[t].apply(this,arguments)})})}function u(e,t){t.forEach(function(t){var r=e[t];n.zone[t]=function(){return r.apply(e,arguments)},e[t]=function(){return n.zone[t].apply(this,arguments)}})}var a=e("../utils");t.exports={patchSetClearFunction:r,patchSetFunction:i,patchRequestAnimationFrame:o,patchFunction:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],10:[function(e,t,n){(function(n){"use strict";function r(){n.navigator&&n.navigator.geolocation&&o.patchPrototype(n.navigator.geolocation,["getCurrentPosition","watchPosition"])}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],11:[function(e,t,n){(function(n){"use strict";function r(e){var t=n[e];if(t){n[e]=function(e){this[i]=new t(n.zone.bind(e,!0)),this[u]=n.zone};var r=new t(function(){});n[e].prototype.disconnect=function(){var e=this[i].disconnect.apply(this[i],arguments);return this[a]&&(this[u].dequeueTask(),this[a]=!1),e},n[e].prototype.observe=function(){return this[a]||(this[u].enqueueTask(),this[a]=!0),this[i].observe.apply(this[i],arguments)};var o;for(o in r)!function(t){void 0===typeof n[e].prototype&&("function"==typeof r[t]?n[e].prototype[t]=function(){return this[i][t].apply(this[i],arguments)}:Object.defineProperty(n[e].prototype,t,{set:function(e){"function"==typeof e?this[i][t]=n.zone.bind(e):this[i][t]=e},get:function(){return this[i][t]}}))}(o)}}var o=e("../keys"),i=o.create("originalInstance"),u=o.create("creationZone"),a=o.create("isActive");t.exports={patchClass:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../keys":3}],12:[function(e,t,n){(function(n){"use strict";function r(e,t){var r=n,o=e.every(function(e){return r=r[e]});o&&t.forEach(function(e){var t=r[e];t&&(r[e]=u(t))})}function o(e){var t=e.then;e.then=function(){var n=a.bindArguments(arguments),r=t.apply(e,n);return o(r)};var n=e["catch"];return e["catch"]=function(){var t=a.bindArguments(arguments),r=n.apply(e,t);return o(r)},e}function i(){if(n.Promise){a.patchPrototype(Promise.prototype,["then","catch"]);var e=[[[],["fetch"]],[["Response","prototype"],["arrayBuffer","blob","json","text"]]];e.forEach(function(e){r(e[0],e[1])})}}var u,a=e("../utils");u=n.Promise?function(e){return function(){var t=e.apply(this,arguments);return t instanceof Promise?t:new Promise(function(e,n){t.then(e,n)})}}:function(e){return function(){return o(e.apply(this,arguments))}},t.exports={apply:i,bindPromiseFn:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],13:[function(e,t,n){(function(n){"use strict";function r(){if(!a.isWebWorker()){var e="undefined"!=typeof WebSocket;if(o()){var t=c.map(function(e){return"on"+e});a.patchProperties(HTMLElement.prototype,t),a.patchProperties(XMLHttpRequest.prototype),e&&a.patchProperties(WebSocket.prototype)}else i(),a.patchClass("XMLHttpRequest"),e&&u.apply()}}function o(){if(!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(HTMLElement.prototype,"onclick",{get:function(){return!0}});var t=document.createElement("div"),n=!!t.onclick;return Object.defineProperty(HTMLElement.prototype,"onclick",{}),n}function i(){c.forEach(function(e){var t="on"+e;document.addEventListener(e,function(e){for(var r,o=e.target;o;)o[t]&&!o[t][f]&&(r=n.zone.bind(o[t]),r[f]=o[t],o[t]=r),o=o.parentElement},!0)})}var u=e("./websocket"),a=e("../utils"),s=e("../keys"),c="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(" "),f=s.create("unbound");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../keys":3,"../utils":16,"./websocket":15}],14:[function(e,t,n){(function(n){"use strict";function r(){if(!i.isWebWorker()&&"registerElement"in n.document){var e=document.registerElement,t=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(r,i){return i&&i.prototype&&t.forEach(function(e){if(i.prototype.hasOwnProperty(e)){var t=Object.getOwnPropertyDescriptor(i.prototype,e);t&&t.value?(t.value=n.zone.bind(t.value),o(i.prototype,e,t)):i.prototype[e]=n.zone.bind(i.prototype[e])}else i.prototype[e]&&(i.prototype[e]=n.zone.bind(i.prototype[e]))}),e.apply(document,[r,i])}}}var o=e("./define-property")._redefineProperty,i=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16,"./define-property":6}],15:[function(e,t,n){(function(n){"use strict";function r(){var e=n.WebSocket;o.patchEventTargetMethods(e.prototype),n.WebSocket=function(t,n){var r,i=arguments.length>1?new e(t,n):new e(t),u=Object.getOwnPropertyDescriptor(i,"onmessage");return u&&u.configurable===!1?(r=Object.create(i),["addEventListener","removeEventListener","send","close"].forEach(function(e){r[e]=function(){return i[e].apply(i,arguments)}})):r=i,o.patchProperties(r,["onclose","onerror","onmessage","onopen"]),r}}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":16}],16:[function(e,t,n){(function(n){"use strict";function r(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=n.zone.bind(e[t]));return e}function o(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=n.zone.bindOnce(e[t]));return e}function i(e,t){t.forEach(function(t){var n=e[t];n&&(e[t]=function(){return n.apply(this,r(arguments))})})}function u(){return"undefined"==typeof document}function a(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){this[o]&&this.removeEventListener(r,this[o]),"function"==typeof e?(this[o]=e,this.addEventListener(r,e,!1)):this[o]=null},n.get=function(){return this[o]},Object.defineProperty(e,t,n)}function s(e,t){(t||function(){var t=[];for(var n in e)t.push(n);return t}().filter(function(e){return"on"===e.substr(0,2)})).forEach(function(t){a(e,t)})}function c(e){e[p.common.addEventListener]=e.addEventListener,e.addEventListener=function(e,t,r){var o,i=e+(r?"$capturing":"$bubbling");return"[object FunctionWrapper]"!==t.toString()&&(o=t.handleEvent?function(e){return function(){e.handleEvent.apply(e,arguments)}}(t):t,t[l]=o,t[d]=t[d]||{},t[d][i]=t[d][i]||zone.bind(o),arguments[1]=t[d][i]),n.zone.addEventListener.apply(this,arguments)},e[p.common.removeEventListener]=e.removeEventListener,e.removeEventListener=function(e,t,r){var o=e+(r?"$capturing":"$bubbling");if(t[d]&&t[d][o]){var i=t[d];arguments[1]=i[o],delete i[o]}var u=n.zone.removeEventListener.apply(this,arguments);return n.zone.dequeueTask(t[l]),u}}function f(e){var t=n[e];if(t){n[e]=function(){var e=r(arguments);switch(e.length){case 0:this[y]=new t;break;case 1:this[y]=new t(e[0]);break;case 2:this[y]=new t(e[0],e[1]);break;case 3:this[y]=new t(e[0],e[1],e[2]);break;case 4:this[y]=new t(e[0],e[1],e[2],e[3]);break;default:throw new Error("what are you even doing?")}};var o,i=new t;for(o in i)!function(t){"function"==typeof i[t]?n[e].prototype[t]=function(){return this[y][t].apply(this[y],arguments)}:Object.defineProperty(n[e].prototype,t,{set:function(e){"function"==typeof e?this[y][t]=n.zone.bind(e):this[y][t]=e},get:function(){return this[y][t]}})}(o);for(o in t)"prototype"!==o&&t.hasOwnProperty(o)&&(n[e][o]=t[o])}}var p=e("./keys"),l=p.create("originalFn"),d=p.create("boundFns"),y=p.create("originalInstance");t.exports={bindArguments:r,bindArgumentsOnce:o,patchPrototype:i,patchProperty:a,patchProperties:s,patchEventTargetMethods:c,patchClass:f,isWebWorker:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":3}],17:[function(e,t,n){(function(n,r){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function a(e){U=e}function s(e){G=e}function c(){return function(){n.nextTick(y)}}function f(){return function(){$(y)}}function p(){var e=0,t=new V(y),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=y,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(y,1)}}function y(){for(var e=0;Y>e;e+=2){var t=te[e],n=te[e+1];t(n),te[e]=void 0,te[e+1]=void 0}Y=0}function h(){try{var t=e,n=t("vertx");return $=n.runOnLoop||n.runOnContext,f()}catch(r){return d()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function g(){return new TypeError("A promises callback cannot return that same promise.")}function b(e){try{return e.then}catch(t){return ie.error=t,ie}}function w(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function E(e,t,n){G(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?P(e,n):x(e,n))},function(t){r||(r=!0,j(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,j(e,o))},e)}function _(e,t){t._state===re?x(e,t._result):t._state===oe?j(e,t._result):z(t,void 0,function(t){P(e,t)},function(t){j(e,t)})}function k(e,t){if(t.constructor===e.constructor)_(e,t);else{var n=b(t);n===ie?j(e,ie.error):void 0===n?x(e,t):i(n)?E(e,t,n):x(e,t)}}function P(e,t){e===t?j(e,m()):o(t)?k(e,t):x(e,t)}function O(e){e._onerror&&e._onerror(e._result),T(e)}function x(e,t){e._state===ne&&(e._result=t,e._state=re,0!==e._subscribers.length&&G(T,e))}function j(e,t){e._state===ne&&(e._state=oe,e._result=t,G(O,e))}function z(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+re]=n,o[i+oe]=r,0===i&&e._state&&G(T,e)}function T(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,u=0;uu;u++)z(r.resolve(e[u]),void 0,t,n);return o}function W(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(v);return P(n,e),n}function R(e){var t=this,n=new t(v);return j(n,e),n}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(e){this._id=le++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&(i(e)||Z(),this instanceof H||D(),S(this,e))}function I(){var e;if("undefined"!=typeof r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=de)}var N;N=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var $,U,X,K=N,Y=0,G=({}.toString,function(e,t){te[Y]=e,te[Y+1]=t,Y+=2,2===Y&&(U?U(y):X())}),J="undefined"!=typeof window?window:void 0,B=J||{},V=B.MutationObserver||B.WebKitMutationObserver,Q="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),ee="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);X=Q?c():V?p():ee?l():void 0===J&&"function"==typeof e?h():d();var ne=void 0,re=1,oe=2,ie=new L,ue=new L;M.prototype._validateInput=function(e){return K(e)},M.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},M.prototype._init=function(){this._result=new Array(this.length)};var ae=M;M.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===ne&&t>o;o++)e._eachEntry(r[o],o)},M.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;u(e)?e.constructor===r&&e._state!==ne?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},M.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===ne&&(r._remaining--,e===oe?j(o,n):r._result[t]=n),0===r._remaining&&x(o,r._result)},M.prototype._willSettleAt=function(e,t){var n=this;z(e,void 0,function(e){n._settledAt(re,t,e)},function(e){n._settledAt(oe,t,e)})};var se=q,ce=F,fe=W,pe=R,le=0,de=H;H.all=se,H.race=ce,H.resolve=fe,H.reject=pe,H._setScheduler=a,H._setAsap=s,H._asap=G,H.prototype={constructor:H,then:function(e,t){var n=this,r=n._state;if(r===re&&!e||r===oe&&!t)return this;var o=new this.constructor(v),i=n._result;if(r){var u=arguments[r-1];G(function(){C(r,o,u,i)})}else z(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var ye=I,he={Promise:de,polyfill:ye};"function"==typeof define&&define.amd?define(function(){return he}):"undefined"!=typeof t&&t.exports?t.exports=he:"undefined"!=typeof this&&(this.ES6Promise=he),ye()}).call(this)}).call(this,{},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file diff --git a/dist/zone.js b/dist/zone.js index 4fb4ec693..e332f93f9 100644 --- a/dist/zone.js +++ b/dist/zone.js @@ -15,10 +15,12 @@ global.zone = new global.Zone(); browserPatch.apply(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../core":2,"../patch/browser":3}],2:[function(require,module,exports){ +},{"../core":2,"../patch/browser":4}],2:[function(require,module,exports){ (function (global){ 'use strict'; +var keys = require('./keys'); + function Zone(parentZone, data) { var zone = (arguments.length) ? Object.create(parentZone) : this; @@ -138,7 +140,13 @@ Zone.prototype = { onZoneCreated: function () {}, afterTask: function () {}, enqueueTask: function () {}, - dequeueTask: function () {} + dequeueTask: function () {}, + addEventListener: function () { + return this[keys.common.addEventListener].apply(this, arguments); + }, + removeEventListener: function () { + return this[keys.common.removeEventListener].apply(this, arguments); + } }; // Root zone ID === 1 @@ -151,7 +159,31 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./patch/promise":9}],3:[function(require,module,exports){ +},{"./keys":3,"./patch/promise":11}],3:[function(require,module,exports){ +/** + * Creates keys for `private` properties on exposed objects to minimize interactions with other codebases. + * The key will be a Symbol if the host supports it; otherwise a prefixed string. + */ +if (typeof Symbol !== 'undefined') { + function create(name) { + return Symbol(name); + } +} else { + function create(name) { + return '_zone$' + name; + } +} + +var commonKeys = { + addEventListener: create('addEventListener'), + removeEventListener: create('removeEventListener') +}; + +module.exports = { + create: create, + common: commonKeys +}; +},{}],4:[function(require,module,exports){ (function (global){ 'use strict'; @@ -164,6 +196,7 @@ var webSocketPatch = require('./websocket'); var eventTargetPatch = require('./event-target'); var propertyDescriptorPatch = require('./property-descriptor'); var geolocationPatch = require('./geolocation'); +var fileReaderPatch = require('./file-reader'); function apply() { fnPatch.patchSetClearFunction(global, [ @@ -197,6 +230,8 @@ function apply() { registerElementPatch.apply(); geolocationPatch.apply(); + + fileReaderPatch.apply(); } module.exports = { @@ -204,15 +239,18 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./define-property":4,"./event-target":5,"./functions":6,"./geolocation":7,"./mutation-observer":8,"./promise":9,"./property-descriptor":10,"./register-element":11,"./websocket":12}],4:[function(require,module,exports){ +},{"./define-property":5,"./event-target":6,"./file-reader":7,"./functions":8,"./geolocation":9,"./mutation-observer":10,"./promise":11,"./property-descriptor":12,"./register-element":13,"./websocket":14}],5:[function(require,module,exports){ 'use strict'; +var keys = require('../keys'); + // might need similar for object.freeze // i regret nothing var _defineProperty = Object.defineProperty; var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var _create = Object.create; +var unconfigurablesKey = keys.create('unconfigurables'); function apply() { Object.defineProperty = function (obj, prop, desc) { @@ -256,16 +294,16 @@ function _redefineProperty(obj, prop, desc) { }; function isUnconfigurable (obj, prop) { - return obj && obj.__unconfigurables && obj.__unconfigurables[prop]; + return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; } function rewriteDescriptor (obj, prop, desc) { desc.configurable = true; if (!desc.configurable) { - if (!obj.__unconfigurables) { - _defineProperty(obj, '__unconfigurables', { writable: true, value: {} }); + if (!obj[unconfigurablesKey]) { + _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); } - obj.__unconfigurables[prop] = true; + obj[unconfigurablesKey][prop] = true; } return desc; } @@ -277,7 +315,7 @@ module.exports = { -},{}],5:[function(require,module,exports){ +},{"../keys":3}],6:[function(require,module,exports){ (function (global){ 'use strict'; @@ -291,7 +329,8 @@ function apply() { // Note: EventTarget is not available in all browsers, // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget } else { - var apis = [ 'ApplicationCache', + var apis = [ + 'ApplicationCache', 'EventSource', 'FileReader', 'InputMethodContext', @@ -314,7 +353,14 @@ function apply() { ]; apis.forEach(function(thing) { - global[thing] && utils.patchEventTargetMethods(global[thing].prototype); + var obj = global[thing] && global[thing].prototype; + + // Some browsers e.g. Android 4.3's don't actually implement + // the EventTarget methods for all of these e.g. FileReader. + // In this case, there is nothing to patch. + if (obj && obj.addEventListener) { + utils.patchEventTargetMethods(obj); + } }); } } @@ -324,7 +370,19 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13}],6:[function(require,module,exports){ +},{"../utils":15}],7:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); + +function apply() { + utils.patchClass('FileReader'); +} + +module.exports = { + apply: apply +}; +},{"../utils":15}],8:[function(require,module,exports){ (function (global){ 'use strict'; @@ -446,7 +504,7 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13}],7:[function(require,module,exports){ +},{"../utils":15}],9:[function(require,module,exports){ (function (global){ 'use strict'; @@ -466,38 +524,44 @@ module.exports = { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13}],8:[function(require,module,exports){ +},{"../utils":15}],10:[function(require,module,exports){ (function (global){ 'use strict'; +var keys = require('../keys'); + +var originalInstanceKey = keys.create('originalInstance'); +var creationZoneKey = keys.create('creationZone'); +var isActiveKey = keys.create('isActive'); + // wrap some native API on `window` function patchClass(className) { var OriginalClass = global[className]; if (!OriginalClass) return; global[className] = function (fn) { - this._o = new OriginalClass(global.zone.bind(fn, true)); + this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true)); // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks - this._creationZone = global.zone; + this[creationZoneKey] = global.zone; }; var instance = new OriginalClass(function () {}); global[className].prototype.disconnect = function () { - var result = this._o.disconnect.apply(this._o, arguments); - if (this._active) { - this._creationZone.dequeueTask(); - this._active = false; + var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments); + if (this[isActiveKey]) { + this[creationZoneKey].dequeueTask(); + this[isActiveKey] = false; } return result; }; global[className].prototype.observe = function () { - if (!this._active) { - this._creationZone.enqueueTask(); - this._active = true; + if (!this[isActiveKey]) { + this[creationZoneKey].enqueueTask(); + this[isActiveKey] = true; } - return this._o.observe.apply(this._o, arguments); + return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments); }; var prop; @@ -508,19 +572,19 @@ function patchClass(className) { } if (typeof instance[prop] === 'function') { global[className].prototype[prop] = function () { - return this._o[prop].apply(this._o, arguments); + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); }; } else { Object.defineProperty(global[className].prototype, prop, { set: function (fn) { if (typeof fn === 'function') { - this._o[prop] = global.zone.bind(fn); + this[originalInstanceKey][prop] = global.zone.bind(fn); } else { - this._o[prop] = fn; + this[originalInstanceKey][prop] = fn; } }, get: function () { - return this._o[prop]; + return this[originalInstanceKey][prop]; } }); } @@ -533,7 +597,7 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],9:[function(require,module,exports){ +},{"../keys":3}],11:[function(require,module,exports){ (function (global){ 'use strict'; @@ -652,12 +716,13 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13}],10:[function(require,module,exports){ +},{"../utils":15}],12:[function(require,module,exports){ (function (global){ 'use strict'; var webSocketPatch = require('./websocket'); var utils = require('../utils'); +var keys = require('../keys'); var eventNames = '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(' '); @@ -707,6 +772,8 @@ function canPatchViaPropertyDescriptor() { return result; }; +var unboundKey = keys.create('unbound'); + // Whenever any event fires, we check the event target and all parents // for `onwhatever` properties and replace them with zone-bound functions // - Chrome (for now) @@ -716,9 +783,9 @@ function patchViaCapturingAllTheEvents() { document.addEventListener(property, function (event) { var elt = event.target, bound; while (elt) { - if (elt[onproperty] && !elt[onproperty]._unbound) { + if (elt[onproperty] && !elt[onproperty][unboundKey]) { bound = global.zone.bind(elt[onproperty]); - bound._unbound = elt[onproperty]; + bound[unboundKey] = elt[onproperty]; elt[onproperty] = bound; } elt = elt.parentElement; @@ -732,7 +799,7 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13,"./websocket":12}],11:[function(require,module,exports){ +},{"../keys":3,"../utils":15,"./websocket":14}],13:[function(require,module,exports){ (function (global){ 'use strict'; @@ -778,7 +845,7 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13,"./define-property":4}],12:[function(require,module,exports){ +},{"../utils":15,"./define-property":5}],14:[function(require,module,exports){ (function (global){ 'use strict'; @@ -817,10 +884,12 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":13}],13:[function(require,module,exports){ +},{"../utils":15}],15:[function(require,module,exports){ (function (global){ 'use strict'; +var keys = require('./keys'); + function bindArguments(args) { for (var i = args.length - 1; i >= 0; i--) { if (typeof args[i] === 'function') { @@ -893,7 +962,6 @@ function patchProperty(obj, prop) { }; function patchProperties(obj, properties) { - (properties || (function () { var props = []; for (var prop in obj) { @@ -909,9 +977,14 @@ function patchProperties(obj, properties) { }); }; +var originalFnKey = keys.create('originalFn'); +var boundFnsKey = keys.create('boundFns'); + function patchEventTargetMethods(obj) { - var addDelegate = obj.addEventListener; - obj.addEventListener = function (eventName, handler) { + // This is required for the addEventListener hook on the root zone. + obj[keys.common.addEventListener] = obj.addEventListener; + obj.addEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); var fn; //Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 if (handler.toString() !== "[object FunctionWrapper]") { @@ -925,29 +998,35 @@ function patchEventTargetMethods(obj) { })(handler); } else { fn = handler; - } + } - handler._fn = fn; - handler._bound = handler._bound || {}; - arguments[1] = handler._bound[eventName] = zone.bind(fn); + handler[originalFnKey] = fn; + handler[boundFnsKey] = handler[boundFnsKey] || {}; + handler[boundFnsKey][eventType] = handler[boundFnsKey][eventType] || zone.bind(fn); + arguments[1] = handler[boundFnsKey][eventType]; } - return addDelegate.apply(this, arguments); + + return global.zone.addEventListener.apply(this, arguments); }; - var removeDelegate = obj.removeEventListener; - obj.removeEventListener = function (eventName, handler) { - if(handler._bound && handler._bound[eventName]) { - var _bound = handler._bound; + // This is required for the removeEventListener hook on the root zone. + obj[keys.common.removeEventListener] = obj.removeEventListener; + obj.removeEventListener = function (eventName, handler, useCapturing) { + var eventType = eventName + (useCapturing ? '$capturing' : '$bubbling'); + if (handler[boundFnsKey] && handler[boundFnsKey][eventType]) { + var _bound = handler[boundFnsKey]; - arguments[1] = _bound[eventName]; - delete _bound[eventName]; + arguments[1] = _bound[eventType]; + delete _bound[eventType]; } - var result = removeDelegate.apply(this, arguments); - global.zone.dequeueTask(handler._fn); + var result = global.zone.removeEventListener.apply(this, arguments); + global.zone.dequeueTask(handler[originalFnKey]); return result; }; }; +var originalInstanceKey = keys.create('originalInstance'); + // wrap some native API on `window` function patchClass(className) { var OriginalClass = global[className]; @@ -956,11 +1035,11 @@ function patchClass(className) { global[className] = function () { var a = bindArguments(arguments); switch (a.length) { - case 0: this._o = new OriginalClass(); break; - case 1: this._o = new OriginalClass(a[0]); break; - case 2: this._o = new OriginalClass(a[0], a[1]); break; - case 3: this._o = new OriginalClass(a[0], a[1], a[2]); break; - case 4: this._o = new OriginalClass(a[0], a[1], a[2], a[3]); break; + case 0: this[originalInstanceKey] = new OriginalClass(); break; + case 1: this[originalInstanceKey] = new OriginalClass(a[0]); break; + case 2: this[originalInstanceKey] = new OriginalClass(a[0], a[1]); break; + case 3: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); break; + case 4: this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); break; default: throw new Error('what are you even doing?'); } }; @@ -972,19 +1051,19 @@ function patchClass(className) { (function (prop) { if (typeof instance[prop] === 'function') { global[className].prototype[prop] = function () { - return this._o[prop].apply(this._o, arguments); + return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); }; } else { Object.defineProperty(global[className].prototype, prop, { set: function (fn) { if (typeof fn === 'function') { - this._o[prop] = global.zone.bind(fn); + this[originalInstanceKey][prop] = global.zone.bind(fn); } else { - this._o[prop] = fn; + this[originalInstanceKey][prop] = fn; } }, get: function () { - return this._o[prop]; + return this[originalInstanceKey][prop]; } }); } @@ -1010,4 +1089,4 @@ module.exports = { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}]},{},[1]); +},{"./keys":3}]},{},[1]); diff --git a/dist/zone.min.js b/dist/zone.min.js index 202ab8d0c..51b3d3e62 100644 --- a/dist/zone.min.js +++ b/dist/zone.min.js @@ -1 +1 @@ -!function e(t,n,o){function r(u,a){if(!n[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return r(n?n:e)},f,f.exports,e,t,n,o)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u1?new e(t,n):new e(t),u=Object.getOwnPropertyDescriptor(i,"onmessage");return u&&u.configurable===!1?(o=Object.create(i),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return i[e].apply(i,arguments)}})):o=i,r.patchProperties(o,["onclose","onerror","onmessage","onopen"]),o}}var r=e("../utils");t.exports={apply:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":13}],13:[function(e,t,n){(function(e){"use strict";function n(t){for(var n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=e.zone.bind(t[n]));return t}function o(t){for(var n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=e.zone.bindOnce(t[n]));return t}function r(e,t){t.forEach(function(t){var o=e[t];o&&(e[t]=function(){return o.apply(this,n(arguments))})})}function i(){return"undefined"==typeof document}function u(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||{enumerable:!0,configurable:!0};delete n.writable,delete n.value;var o=t.substr(2),r="_"+t;n.set=function(e){this[r]&&this.removeEventListener(o,this[r]),"function"==typeof e?(this[r]=e,this.addEventListener(o,e,!1)):this[r]=null},n.get=function(){return this[r]},Object.defineProperty(e,t,n)}function a(e,t){(t||function(){var t=[];for(var n in e)t.push(n);return t}().filter(function(e){return"on"===e.substr(0,2)})).forEach(function(t){u(e,t)})}function c(t){var n=t.addEventListener;t.addEventListener=function(e,t){var o;return"[object FunctionWrapper]"!==t.toString()&&(o=t.handleEvent?function(e){return function(){e.handleEvent.apply(e,arguments)}}(t):t,t._fn=o,t._bound=t._bound||{},arguments[1]=t._bound[e]=zone.bind(o)),n.apply(this,arguments)};var o=t.removeEventListener;t.removeEventListener=function(t,n){if(n._bound&&n._bound[t]){var r=n._bound;arguments[1]=r[t],delete r[t]}var i=o.apply(this,arguments);return e.zone.dequeueTask(n._fn),i}}function s(t){var o=e[t];if(o){e[t]=function(){var e=n(arguments);switch(e.length){case 0:this._o=new o;break;case 1:this._o=new o(e[0]);break;case 2:this._o=new o(e[0],e[1]);break;case 3:this._o=new o(e[0],e[1],e[2]);break;case 4:this._o=new o(e[0],e[1],e[2],e[3]);break;default:throw new Error("what are you even doing?")}};var r,i=new o;for(r in i)!function(n){"function"==typeof i[n]?e[t].prototype[n]=function(){return this._o[n].apply(this._o,arguments)}:Object.defineProperty(e[t].prototype,n,{set:function(t){this._o[n]="function"==typeof t?e.zone.bind(t):t},get:function(){return this._o[n]}})}(r);for(r in o)"prototype"!==r&&o.hasOwnProperty(r)&&(e[t][r]=o[r])}}t.exports={bindArguments:n,bindArgumentsOnce:o,patchPrototype:r,patchProperty:u,patchProperties:a,patchEventTargetMethods:c,patchClass:s,isWebWorker:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file +!function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a1?new e(t,n):new e(t),a=Object.getOwnPropertyDescriptor(i,"onmessage");return a&&a.configurable===!1?(r=Object.create(i),["addEventListener","removeEventListener","send","close"].forEach(function(e){r[e]=function(){return i[e].apply(i,arguments)}})):r=i,o.patchProperties(r,["onclose","onerror","onmessage","onopen"]),r}}var o=e("../utils");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils":15}],15:[function(e,t,n){(function(n){"use strict";function r(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=n.zone.bind(e[t]));return e}function o(e){for(var t=e.length-1;t>=0;t--)"function"==typeof e[t]&&(e[t]=n.zone.bindOnce(e[t]));return e}function i(e,t){t.forEach(function(t){var n=e[t];n&&(e[t]=function(){return n.apply(this,r(arguments))})})}function a(){return"undefined"==typeof document}function u(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){this[o]&&this.removeEventListener(r,this[o]),"function"==typeof e?(this[o]=e,this.addEventListener(r,e,!1)):this[o]=null},n.get=function(){return this[o]},Object.defineProperty(e,t,n)}function s(e,t){(t||function(){var t=[];for(var n in e)t.push(n);return t}().filter(function(e){return"on"===e.substr(0,2)})).forEach(function(t){u(e,t)})}function c(e){e[f.common.addEventListener]=e.addEventListener,e.addEventListener=function(e,t,r){var o,i=e+(r?"$capturing":"$bubbling");return"[object FunctionWrapper]"!==t.toString()&&(o=t.handleEvent?function(e){return function(){e.handleEvent.apply(e,arguments)}}(t):t,t[l]=o,t[d]=t[d]||{},t[d][i]=t[d][i]||zone.bind(o),arguments[1]=t[d][i]),n.zone.addEventListener.apply(this,arguments)},e[f.common.removeEventListener]=e.removeEventListener,e.removeEventListener=function(e,t,r){var o=e+(r?"$capturing":"$bubbling");if(t[d]&&t[d][o]){var i=t[d];arguments[1]=i[o],delete i[o]}var a=n.zone.removeEventListener.apply(this,arguments);return n.zone.dequeueTask(t[l]),a}}function p(e){var t=n[e];if(t){n[e]=function(){var e=r(arguments);switch(e.length){case 0:this[y]=new t;break;case 1:this[y]=new t(e[0]);break;case 2:this[y]=new t(e[0],e[1]);break;case 3:this[y]=new t(e[0],e[1],e[2]);break;case 4:this[y]=new t(e[0],e[1],e[2],e[3]);break;default:throw new Error("what are you even doing?")}};var o,i=new t;for(o in i)!function(t){"function"==typeof i[t]?n[e].prototype[t]=function(){return this[y][t].apply(this[y],arguments)}:Object.defineProperty(n[e].prototype,t,{set:function(e){"function"==typeof e?this[y][t]=n.zone.bind(e):this[y][t]=e},get:function(){return this[y][t]}})}(o);for(o in t)"prototype"!==o&&t.hasOwnProperty(o)&&(n[e][o]=t[o])}}var f=e("./keys"),l=f.create("originalFn"),d=f.create("boundFns"),y=f.create("originalInstance");t.exports={bindArguments:r,bindArgumentsOnce:o,patchPrototype:i,patchProperty:u,patchProperties:s,patchEventTargetMethods:c,patchClass:p,isWebWorker:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":3}]},{},[1]); \ No newline at end of file diff --git a/package.json b/package.json index 371d0752c..730f4e58f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zone.js", - "version": "0.5.4", + "version": "0.5.5", "description": "Zones for JavaScript", "main": "lib/zone.js", "files": [