@sentry/integrations
Advanced tools
Comparing version 5.19.2 to 5.20.0
@@ -46,7 +46,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -96,2 +91,11 @@ /** | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -260,6 +264,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -275,2 +275,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -277,0 +459,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(n){var t={};Object.defineProperty(t,"__esModule",{value:!0});var r=function(n,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,t)};var e=function(){return(e=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var r in t)n.hasOwnProperty(r)||(n[r]=t[r]);return n});!function(n){function t(t){var r=this.constructor,e=n.call(this,t)||this;return e.message=t,e.name=r.prototype.constructor.name,o(e,r.prototype),e}(function(n,t){function e(){this.constructor=n}r(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)})(t,n)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var a={};function c(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a}function u(n){var t=c();if(!("console"in t))return n();var r=t.console,e={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&r[n].__sentry_original__&&(e[n]=r[n],r[n]=r[n].__sentry_original__)});var o=n();return Object.keys(e).forEach(function(n){r[n]=e[n]}),o}var s=Date.now(),f=0,l={now:function(){var n=Date.now()-s;return n<f&&(n=f),f=n,n},timeOrigin:s},p=(function(){if(i())try{return(n=module,t="perf_hooks",n.require(t)).performance}catch(n){return l}var n,t,r=c().performance;r&&r.now&&(void 0===r.timeOrigin&&(r.timeOrigin=r.timing&&r.timing.navigationStart||s))}(),c()),_="Sentry Logger ",g=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){p.console.log(_+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){p.console.warn(_+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){p.console.error(_+"[Error]: "+n.join(" "))})},n}();p.__SENTRY__=p.__SENTRY__||{};var y,v=p.__SENTRY__.logger||(p.__SENTRY__.logger=new g);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(y||(y={}));c();var d=/^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/,h=function(){function n(t){void 0===t&&(t={}),this.name=n.id,this._angular=t.angular||c().angular}return n.prototype.setupOnce=function(t,r){var e=this;this._angular?(this._getCurrentHub=r,this._angular.module(n.moduleName,[]).config(["$provide",function(n){n.decorator("$exceptionHandler",["$delegate",e._$exceptionHandlerDecorator.bind(e)])}])):v.error("AngularIntegration is missing an Angular instance")},n.prototype._$exceptionHandlerDecorator=function(t){var r=this;return function(o,i){var a=r._getCurrentHub&&r._getCurrentHub();a&&a.getIntegration(n)&&a.withScope(function(n){i&&n.setExtra("cause",i),n.addEventProcessor(function(n){var t=n.exception&&n.exception.values&&n.exception.values[0];if(t){var r=d.exec(t.value||"");r&&(t.type=r[1],t.value=r[2],n.message=t.type+": "+t.value,n.extra=e({},n.extra,{angularDocs:r[3].substr(0,250)}))}return n}),a.captureException(o)}),t(o,i)}},n.id="AngularJS",n.moduleName="ngSentry",n}();for(var b in t.Angular=h,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},t)Object.prototype.hasOwnProperty.call(t,b)&&(n.Sentry.Integrations[b]=t[b])}(window); | ||
!function(n){var t={};Object.defineProperty(t,"__esModule",{value:!0});var e=function(n,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)};var r=function(){return(r=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e]);return n});!function(n){function t(t){var e=this.constructor,r=n.call(this,t)||this;return r.message=t,r.name=e.prototype.constructor.name,o(r,e.prototype),r}(function(n,t){function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,n)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var a={};function c(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a}function u(n){var t=c();if(!("console"in t))return n();var e=t.console,r={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&e[n].__sentry_original__&&(r[n]=e[n],e[n]=e[n].__sentry_original__)});var o=n();return Object.keys(r).forEach(function(n){e[n]=r[n]}),o}var s=Date.now(),f=0,l={now:function(){var n=Date.now()-s;return n<f&&(n=f),f=n,n},timeOrigin:s},_=(function(){if(i())try{return(n=module,t="perf_hooks",n.require(t)).performance}catch(n){return l}var n,t,e=c().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||s))}(),c()),p="Sentry Logger ",h=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){_.console.log(p+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){_.console.warn(p+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&u(function(){_.console.error(p+"[Error]: "+n.join(" "))})},n}();_.__SENTRY__=_.__SENTRY__||{};var d,v=_.__SENTRY__.logger||(_.__SENTRY__.logger=new h);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(d||(d={}));(function(){function n(n){var t=this;this._state=d.PENDING,this._handlers=[],this._resolve=function(n){t._setResult(d.RESOLVED,n)},this._reject=function(n){t._setResult(d.REJECTED,n)},this._setResult=function(n,e){var r;t._state===d.PENDING&&(r=e,Boolean(r&&r.then&&"function"==typeof r.then)?e.then(t._resolve,t._reject):(t._state=n,t._value=e,t._executeHandlers()))},this._attachHandler=function(n){t._handlers=t._handlers.concat(n),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==d.PENDING){var n=t._handlers.slice();t._handlers=[],n.forEach(function(n){n.done||(t._state===d.RESOLVED&&n.onfulfilled&&n.onfulfilled(t._value),t._state===d.REJECTED&&n.onrejected&&n.onrejected(t._value),n.done=!0)})}};try{n(this._resolve,this._reject)}catch(n){this._reject(n)}}n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(t){return new n(function(n){n(t)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.all=function(t){return new n(function(e,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach(function(t,a){n.resolve(t).then(function(n){i[a]=n,0===(o-=1)&&e(i)}).then(null,r)})}else e([]);else r(new TypeError("Promise.all requires an array as input."))})},n.prototype.then=function(t,e){var r=this;return new n(function(n,o){r._attachHandler({done:!1,onfulfilled:function(e){if(t)try{return void n(t(e))}catch(n){return void o(n)}else n(e)},onrejected:function(t){if(e)try{return void n(e(t))}catch(n){return void o(n)}else o(t)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.finally=function(t){var e=this;return new n(function(n,r){var o,i;return e.then(function(n){i=!1,o=n,t&&t()},function(n){i=!0,o=n,t&&t()}).then(function(){i?r(o):n(o)})})}})(),c();var y=/^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/,g=function(){function n(t){void 0===t&&(t={}),this.name=n.id,this._angular=t.angular||c().angular}return n.prototype.setupOnce=function(t,e){var r=this;this._angular?(this._getCurrentHub=e,this._angular.module(n.moduleName,[]).config(["$provide",function(n){n.decorator("$exceptionHandler",["$delegate",r._$exceptionHandlerDecorator.bind(r)])}])):v.error("AngularIntegration is missing an Angular instance")},n.prototype._$exceptionHandlerDecorator=function(t){var e=this;return function(o,i){var a=e._getCurrentHub&&e._getCurrentHub();a&&a.getIntegration(n)&&a.withScope(function(n){i&&n.setExtra("cause",i),n.addEventProcessor(function(n){var t=n.exception&&n.exception.values&&n.exception.values[0];if(t){var e=y.exec(t.value||"");e&&(t.type=e[1],t.value=e[2],n.message=t.type+": "+t.value,n.extra=r({},n.extra,{angularDocs:e[3].substr(0,250)}))}return n}),a.captureException(o)}),t(o,i)}},n.id="AngularJS",n.moduleName="ngSentry",n}();for(var E in t.Angular=g,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},t)Object.prototype.hasOwnProperty.call(t,E)&&(n.Sentry.Integrations[E]=t[E])}(window); | ||
//# sourceMappingURL=angular.min.js.map |
@@ -112,7 +112,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
/*! ***************************************************************************** | ||
@@ -191,2 +186,11 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -379,4 +383,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
/** | ||
@@ -417,4 +419,2 @@ * Wrap a given object method with a higher-order function | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -430,2 +430,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -432,0 +614,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(n){var r,e,t,o={};Object.defineProperty(o,"__esModule",{value:!0}),function(n){n[n.None=0]="None",n[n.Error=1]="Error",n[n.Debug=2]="Debug",n[n.Verbose=3]="Verbose"}(r||(r={})),function(n){n.Fatal="fatal",n.Error="error",n.Warning="warning",n.Log="log",n.Info="info",n.Debug="debug",n.Critical="critical"}(e||(e={})),function(n){n.fromString=function(r){switch(r){case"debug":return n.Debug;case"info":return n.Info;case"warn":case"warning":return n.Warning;case"error":return n.Error;case"fatal":return n.Fatal;case"critical":return n.Critical;case"log":default:return n.Log}}}(e||(e={})),function(n){n.Unknown="unknown",n.Skipped="skipped",n.Success="success",n.RateLimit="rate_limit",n.Invalid="invalid",n.Failed="failed"}(t||(t={})),function(n){n.fromHttpCode=function(r){return r>=200&&r<300?n.Success:429===r?n.RateLimit:r>=400&&r<500?n.Invalid:r>=500?n.Failed:n.Unknown}}(t||(t={}));var i=function(n,r){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var e in r)r.hasOwnProperty(e)&&(n[e]=r[e])})(n,r)};var a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,r){return n.__proto__=r,n}:function(n,r){for(var e in r)n.hasOwnProperty(e)||(n[e]=r[e]);return n});!function(n){function r(r){var e=this.constructor,t=n.call(this,r)||this;return t.message=r,t.name=e.prototype.constructor.name,a(t,e.prototype),t}(function(n,r){function e(){this.constructor=n}i(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)})(r,n)}(Error);function c(n,r){if(!Array.isArray(n))return"";for(var e=[],t=0;t<n.length;t++){var o=n[t];try{e.push(String(o))}catch(n){e.push("[value cannot be serialized]")}}return e.join(r)}function s(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var u={};function f(){return s()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:u}function l(n){var r=f();if(!("console"in r))return n();var e=r.console,t={};["debug","info","warn","error","log","assert"].forEach(function(n){n in r.console&&e[n].__sentry_original__&&(t[n]=e[n],e[n]=e[n].__sentry_original__)});var o=n();return Object.keys(t).forEach(function(n){e[n]=t[n]}),o}var p=Date.now(),_=0,g={now:function(){var n=Date.now()-p;return n<_&&(n=_),_=n,n},timeOrigin:p},y=(function(){if(s())try{return(n=module,r="perf_hooks",n.require(r)).performance}catch(n){return g}var n,r,e=f().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||p))}(),f()),d="Sentry Logger ",v=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&l(function(){y.console.log(d+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&l(function(){y.console.warn(d+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&l(function(){y.console.error(d+"[Error]: "+n.join(" "))})},n}();y.__SENTRY__=y.__SENTRY__||{};var h;y.__SENTRY__.logger||(y.__SENTRY__.logger=new v);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(h||(h={}));f();var b=f(),E=function(){function n(r){void 0===r&&(r={}),this.name=n.id,this._levels=["log","info","warn","error","debug","assert"],r.levels&&(this._levels=r.levels)}return n.prototype.setupOnce=function(r,t){"console"in b&&this._levels.forEach(function(r){r in b.console&&function(n,r,e){if(r in n){var t=n[r],o=e(t);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:t}})}catch(n){}n[r]=o}}(b.console,r,function(o){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=t();s.getIntegration(n)&&s.withScope(function(n){n.setLevel(e.fromString(r)),n.setExtra("arguments",i),n.addEventProcessor(function(n){return n.logger="console",n});var t=c(i," ");"assert"===r?!1===i[0]&&(t="Assertion failed: "+(c(i.slice(1)," ")||"console.assert"),n.setExtra("arguments",i.slice(1)),s.captureMessage(t)):s.captureMessage(t)}),o&&Function.prototype.apply.call(o,b.console,i)}})})},n.id="CaptureConsole",n}();for(var w in o.CaptureConsole=E,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},o)Object.prototype.hasOwnProperty.call(o,w)&&(n.Sentry.Integrations[w]=o[w])}(window); | ||
!function(n){var e,t,r,o={};Object.defineProperty(o,"__esModule",{value:!0}),function(n){n[n.None=0]="None",n[n.Error=1]="Error",n[n.Debug=2]="Debug",n[n.Verbose=3]="Verbose"}(e||(e={})),function(n){n.Fatal="fatal",n.Error="error",n.Warning="warning",n.Log="log",n.Info="info",n.Debug="debug",n.Critical="critical"}(t||(t={})),function(n){n.fromString=function(e){switch(e){case"debug":return n.Debug;case"info":return n.Info;case"warn":case"warning":return n.Warning;case"error":return n.Error;case"fatal":return n.Fatal;case"critical":return n.Critical;case"log":default:return n.Log}}}(t||(t={})),function(n){n.Unknown="unknown",n.Skipped="skipped",n.Success="success",n.RateLimit="rate_limit",n.Invalid="invalid",n.Failed="failed"}(r||(r={})),function(n){n.fromHttpCode=function(e){return e>=200&&e<300?n.Success:429===e?n.RateLimit:e>=400&&e<500?n.Invalid:e>=500?n.Failed:n.Unknown}}(r||(r={}));var i=function(n,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t])})(n,e)};var a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,e){return n.__proto__=e,n}:function(n,e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t]);return n});!function(n){function e(e){var t=this.constructor,r=n.call(this,e)||this;return r.message=e,r.name=t.prototype.constructor.name,a(r,t.prototype),r}(function(n,e){function t(){this.constructor=n}i(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)})(e,n)}(Error);function c(n,e){if(!Array.isArray(n))return"";for(var t=[],r=0;r<n.length;r++){var o=n[r];try{t.push(String(o))}catch(n){t.push("[value cannot be serialized]")}}return t.join(e)}function u(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var s={};function f(){return u()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:s}function l(n){var e=f();if(!("console"in e))return n();var t=e.console,r={};["debug","info","warn","error","log","assert"].forEach(function(n){n in e.console&&t[n].__sentry_original__&&(r[n]=t[n],t[n]=t[n].__sentry_original__)});var o=n();return Object.keys(r).forEach(function(n){t[n]=r[n]}),o}var _=Date.now(),p=0,h={now:function(){var n=Date.now()-_;return n<p&&(n=p),p=n,n},timeOrigin:_},d=(function(){if(u())try{return(n=module,e="perf_hooks",n.require(e)).performance}catch(n){return h}var n,e,t=f().performance;t&&t.now&&(void 0===t.timeOrigin&&(t.timeOrigin=t.timing&&t.timing.navigationStart||_))}(),f()),g="Sentry Logger ",v=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this._enabled&&l(function(){d.console.log(g+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this._enabled&&l(function(){d.console.warn(g+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this._enabled&&l(function(){d.console.error(g+"[Error]: "+n.join(" "))})},n}();d.__SENTRY__=d.__SENTRY__||{};var y;d.__SENTRY__.logger||(d.__SENTRY__.logger=new v);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(y||(y={}));(function(){function n(n){var e=this;this._state=y.PENDING,this._handlers=[],this._resolve=function(n){e._setResult(y.RESOLVED,n)},this._reject=function(n){e._setResult(y.REJECTED,n)},this._setResult=function(n,t){var r;e._state===y.PENDING&&(r=t,Boolean(r&&r.then&&"function"==typeof r.then)?t.then(e._resolve,e._reject):(e._state=n,e._value=t,e._executeHandlers()))},this._attachHandler=function(n){e._handlers=e._handlers.concat(n),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==y.PENDING){var n=e._handlers.slice();e._handlers=[],n.forEach(function(n){n.done||(e._state===y.RESOLVED&&n.onfulfilled&&n.onfulfilled(e._value),e._state===y.REJECTED&&n.onrejected&&n.onrejected(e._value),n.done=!0)})}};try{n(this._resolve,this._reject)}catch(n){this._reject(n)}}n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(e){return new n(function(n){n(e)})},n.reject=function(e){return new n(function(n,t){t(e)})},n.all=function(e){return new n(function(t,r){if(Array.isArray(e))if(0!==e.length){var o=e.length,i=[];e.forEach(function(e,a){n.resolve(e).then(function(n){i[a]=n,0===(o-=1)&&t(i)}).then(null,r)})}else t([]);else r(new TypeError("Promise.all requires an array as input."))})},n.prototype.then=function(e,t){var r=this;return new n(function(n,o){r._attachHandler({done:!1,onfulfilled:function(t){if(e)try{return void n(e(t))}catch(n){return void o(n)}else n(t)},onrejected:function(e){if(t)try{return void n(t(e))}catch(n){return void o(n)}else o(e)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.finally=function(e){var t=this;return new n(function(n,r){var o,i;return t.then(function(n){i=!1,o=n,e&&e()},function(n){i=!0,o=n,e&&e()}).then(function(){i?r(o):n(o)})})}})(),f();var E=f(),w=function(){function n(e){void 0===e&&(e={}),this.name=n.id,this._levels=["log","info","warn","error","debug","assert"],e.levels&&(this._levels=e.levels)}return n.prototype.setupOnce=function(e,r){"console"in E&&this._levels.forEach(function(e){e in E.console&&function(n,e,t){if(e in n){var r=n[e],o=t(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:r}})}catch(n){}n[e]=o}}(E.console,e,function(o){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var u=r();u.getIntegration(n)&&u.withScope(function(n){n.setLevel(t.fromString(e)),n.setExtra("arguments",i),n.addEventProcessor(function(n){return n.logger="console",n});var r=c(i," ");"assert"===e?!1===i[0]&&(r="Assertion failed: "+(c(i.slice(1)," ")||"console.assert"),n.setExtra("arguments",i.slice(1)),u.captureMessage(r)):u.captureMessage(r)}),o&&Function.prototype.apply.call(o,E.console,i)}})})},n.id="CaptureConsole",n}();for(var b in o.CaptureConsole=w,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},o)Object.prototype.hasOwnProperty.call(o,b)&&(n.Sentry.Integrations[b]=o[b])}(window); | ||
//# sourceMappingURL=captureconsole.min.js.map |
@@ -46,7 +46,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -96,2 +91,11 @@ /** | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -260,6 +264,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -275,2 +275,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -277,0 +459,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(n){var o={};Object.defineProperty(o,"__esModule",{value:!0});var t=function(n,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var t in o)o.hasOwnProperty(t)&&(n[t]=o[t])})(n,o)};var r=function(){return(r=Object.assign||function(n){for(var o,t=1,r=arguments.length;t<r;t++)for(var e in o=arguments[t])Object.prototype.hasOwnProperty.call(o,e)&&(n[e]=o[e]);return n}).apply(this,arguments)},e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,o){return n.__proto__=o,n}:function(n,o){for(var t in o)n.hasOwnProperty(t)||(n[t]=o[t]);return n});!function(n){function o(o){var t=this.constructor,r=n.call(this,o)||this;return r.message=o,r.name=t.prototype.constructor.name,e(r,t.prototype),r}(function(n,o){function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)})(o,n)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var c={};function a(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:c}function u(n){var o=a();if(!("console"in o))return n();var t=o.console,r={};["debug","info","warn","error","log","assert"].forEach(function(n){n in o.console&&t[n].__sentry_original__&&(r[n]=t[n],t[n]=t[n].__sentry_original__)});var e=n();return Object.keys(r).forEach(function(n){t[n]=r[n]}),e}var f=Date.now(),s=0,l={now:function(){var n=Date.now()-f;return n<s&&(n=s),s=n,n},timeOrigin:f},p=(function(){if(i())try{return(n=module,o="perf_hooks",n.require(o)).performance}catch(n){return l}var n,o,t=a().performance;t&&t.now&&(void 0===t.timeOrigin&&(t.timeOrigin=t.timing&&t.timing.navigationStart||f))}(),a()),_="Sentry Logger ",g=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];this._enabled&&u(function(){p.console.log(_+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];this._enabled&&u(function(){p.console.warn(_+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];this._enabled&&u(function(){p.console.error(_+"[Error]: "+n.join(" "))})},n}();p.__SENTRY__=p.__SENTRY__||{};var y;p.__SENTRY__.logger||(p.__SENTRY__.logger=new g);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(y||(y={}));a();var d=function(){function n(o){this.name=n.id,this._options=r({debugger:!1,stringify:!1},o)}return n.prototype.setupOnce=function(o,t){o(function(o,r){var e=t().getIntegration(n);return e&&(e._options.debugger,u(function(){e._options.stringify?(console.log(JSON.stringify(o,null,2)),r&&console.log(JSON.stringify(r,null,2))):(console.log(o),r&&console.log(r))})),o})},n.id="Debug",n}();for(var h in o.Debug=d,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},o)Object.prototype.hasOwnProperty.call(o,h)&&(n.Sentry.Integrations[h]=o[h])}(window); | ||
!function(n){var t={};Object.defineProperty(t,"__esModule",{value:!0});var e=function(n,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)};var r=function(){return(r=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e]);return n});!function(n){function t(t){var e=this.constructor,r=n.call(this,t)||this;return r.message=t,r.name=e.prototype.constructor.name,o(r,e.prototype),r}(function(n,t){function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,n)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var c={};function u(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:c}function a(n){var t=u();if(!("console"in t))return n();var e=t.console,r={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&e[n].__sentry_original__&&(r[n]=e[n],e[n]=e[n].__sentry_original__)});var o=n();return Object.keys(r).forEach(function(n){e[n]=r[n]}),o}var s=Date.now(),f=0,l={now:function(){var n=Date.now()-s;return n<f&&(n=f),f=n,n},timeOrigin:s},_=(function(){if(i())try{return(n=module,t="perf_hooks",n.require(t)).performance}catch(n){return l}var n,t,e=u().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||s))}(),u()),p="Sentry Logger ",h=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){_.console.log(p+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){_.console.warn(p+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){_.console.error(p+"[Error]: "+n.join(" "))})},n}();_.__SENTRY__=_.__SENTRY__||{};var y;_.__SENTRY__.logger||(_.__SENTRY__.logger=new h);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(y||(y={}));(function(){function n(n){var t=this;this._state=y.PENDING,this._handlers=[],this._resolve=function(n){t._setResult(y.RESOLVED,n)},this._reject=function(n){t._setResult(y.REJECTED,n)},this._setResult=function(n,e){var r;t._state===y.PENDING&&(r=e,Boolean(r&&r.then&&"function"==typeof r.then)?e.then(t._resolve,t._reject):(t._state=n,t._value=e,t._executeHandlers()))},this._attachHandler=function(n){t._handlers=t._handlers.concat(n),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==y.PENDING){var n=t._handlers.slice();t._handlers=[],n.forEach(function(n){n.done||(t._state===y.RESOLVED&&n.onfulfilled&&n.onfulfilled(t._value),t._state===y.REJECTED&&n.onrejected&&n.onrejected(t._value),n.done=!0)})}};try{n(this._resolve,this._reject)}catch(n){this._reject(n)}}n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(t){return new n(function(n){n(t)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.all=function(t){return new n(function(e,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach(function(t,c){n.resolve(t).then(function(n){i[c]=n,0===(o-=1)&&e(i)}).then(null,r)})}else e([]);else r(new TypeError("Promise.all requires an array as input."))})},n.prototype.then=function(t,e){var r=this;return new n(function(n,o){r._attachHandler({done:!1,onfulfilled:function(e){if(t)try{return void n(t(e))}catch(n){return void o(n)}else n(e)},onrejected:function(t){if(e)try{return void n(e(t))}catch(n){return void o(n)}else o(t)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.finally=function(t){var e=this;return new n(function(n,r){var o,i;return e.then(function(n){i=!1,o=n,t&&t()},function(n){i=!0,o=n,t&&t()}).then(function(){i?r(o):n(o)})})}})(),u();var g=function(){function n(t){this.name=n.id,this._options=r({debugger:!1,stringify:!1},t)}return n.prototype.setupOnce=function(t,e){t(function(t,r){var o=e().getIntegration(n);return o&&(o._options.debugger,a(function(){o._options.stringify?(console.log(JSON.stringify(t,null,2)),r&&console.log(JSON.stringify(r,null,2))):(console.log(t),r&&console.log(r))})),t})},n.id="Debug",n}();for(var d in t.Debug=g,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},t)Object.prototype.hasOwnProperty.call(t,d)&&(n.Sentry.Integrations[d]=t[d])}(window); | ||
//# sourceMappingURL=debug.min.js.map |
@@ -6,7 +6,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
/*! ***************************************************************************** | ||
@@ -86,2 +81,11 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
/** | ||
* Checks whether given value's type is an instance of provided constructor. | ||
@@ -266,6 +270,2 @@ * {@link isInstanceOf}. | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -281,2 +281,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -283,0 +465,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(n){var r={};Object.defineProperty(r,"__esModule",{value:!0});var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)};var e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,r){return n.__proto__=r,n}:function(n,r){for(var t in r)n.hasOwnProperty(t)||(n[t]=r[t]);return n});!function(n){function r(r){var t=this.constructor,o=n.call(this,r)||this;return o.message=r,o.name=t.prototype.constructor.name,e(o,t.prototype),o}(function(n,r){function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)})(r,n)}(Error);function o(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var i={};function c(){return o()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(n){var r=c();if(!("console"in r))return n();var t=r.console,e={};["debug","info","warn","error","log","assert"].forEach(function(n){n in r.console&&t[n].__sentry_original__&&(e[n]=t[n],t[n]=t[n].__sentry_original__)});var o=n();return Object.keys(e).forEach(function(n){t[n]=e[n]}),o}var s=Date.now(),f=0,u={now:function(){var n=Date.now()-s;return n<f&&(n=f),f=n,n},timeOrigin:s},_=(function(){if(o())try{return(n=module,r="perf_hooks",n.require(r)).performance}catch(n){return u}var n,r,t=c().performance;t&&t.now&&(void 0===t.timeOrigin&&(t.timeOrigin=t.timing&&t.timing.navigationStart||s))}(),c()),p="Sentry Logger ",l=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&a(function(){_.console.log(p+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&a(function(){_.console.warn(p+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._enabled&&a(function(){_.console.error(p+"[Error]: "+n.join(" "))})},n}();_.__SENTRY__=_.__SENTRY__||{};var E,g=_.__SENTRY__.logger||(_.__SENTRY__.logger=new l);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(E||(E={}));c();var y=function(){function n(r){void 0===r&&(r={}),this.name=n.id,this._Ember=r.Ember||c().Ember}return n.prototype.setupOnce=function(r,t){var e=this;if(this._Ember){var o=this._Ember.onerror;this._Ember.onerror=function(r){if(t().getIntegration(n)&&t().captureException(r,{originalException:r}),"function"==typeof o)o.call(e._Ember,r);else if(e._Ember.testing)throw r},this._Ember.RSVP.on("error",function(r){t().getIntegration(n)&&t().withScope(function(n){!function(n,r){try{return n instanceof r}catch(n){return!1}}(r,Error)?(n.setExtra("reason",r),t().captureMessage("Unhandled Promise error detected")):(n.setExtra("context","Unhandled Promise error detected"),t().captureException(r,{originalException:r}))})})}else g.error("EmberIntegration is missing an Ember instance")},n.id="Ember",n}();for(var d in r.Ember=y,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},r)Object.prototype.hasOwnProperty.call(r,d)&&(n.Sentry.Integrations[d]=r[d])}(window); | ||
!function(n){var t={};Object.defineProperty(t,"__esModule",{value:!0});var e=function(n,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)};var r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e]);return n});!function(n){function t(t){var e=this.constructor,o=n.call(this,t)||this;return o.message=t,o.name=e.prototype.constructor.name,r(o,e.prototype),o}(function(n,t){function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,n)}(Error);function o(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var i={};function c(){return o()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(n){var t=c();if(!("console"in t))return n();var e=t.console,r={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&e[n].__sentry_original__&&(r[n]=e[n],e[n]=e[n].__sentry_original__)});var o=n();return Object.keys(r).forEach(function(n){e[n]=r[n]}),o}var u=Date.now(),s=0,f={now:function(){var n=Date.now()-u;return n<s&&(n=s),s=n,n},timeOrigin:u},l=(function(){if(o())try{return(n=module,t="perf_hooks",n.require(t)).performance}catch(n){return f}var n,t,e=c().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||u))}(),c()),_="Sentry Logger ",h=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){l.console.log(_+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){l.console.warn(_+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&a(function(){l.console.error(_+"[Error]: "+n.join(" "))})},n}();l.__SENTRY__=l.__SENTRY__||{};var p,E=l.__SENTRY__.logger||(l.__SENTRY__.logger=new h);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(p||(p={}));(function(){function n(n){var t=this;this._state=p.PENDING,this._handlers=[],this._resolve=function(n){t._setResult(p.RESOLVED,n)},this._reject=function(n){t._setResult(p.REJECTED,n)},this._setResult=function(n,e){var r;t._state===p.PENDING&&(r=e,Boolean(r&&r.then&&"function"==typeof r.then)?e.then(t._resolve,t._reject):(t._state=n,t._value=e,t._executeHandlers()))},this._attachHandler=function(n){t._handlers=t._handlers.concat(n),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==p.PENDING){var n=t._handlers.slice();t._handlers=[],n.forEach(function(n){n.done||(t._state===p.RESOLVED&&n.onfulfilled&&n.onfulfilled(t._value),t._state===p.REJECTED&&n.onrejected&&n.onrejected(t._value),n.done=!0)})}};try{n(this._resolve,this._reject)}catch(n){this._reject(n)}}n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(t){return new n(function(n){n(t)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.all=function(t){return new n(function(e,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach(function(t,c){n.resolve(t).then(function(n){i[c]=n,0===(o-=1)&&e(i)}).then(null,r)})}else e([]);else r(new TypeError("Promise.all requires an array as input."))})},n.prototype.then=function(t,e){var r=this;return new n(function(n,o){r._attachHandler({done:!1,onfulfilled:function(e){if(t)try{return void n(t(e))}catch(n){return void o(n)}else n(e)},onrejected:function(t){if(e)try{return void n(e(t))}catch(n){return void o(n)}else o(t)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.finally=function(t){var e=this;return new n(function(n,r){var o,i;return e.then(function(n){i=!1,o=n,t&&t()},function(n){i=!0,o=n,t&&t()}).then(function(){i?r(o):n(o)})})}})(),c();var d=function(){function n(t){void 0===t&&(t={}),this.name=n.id,this._Ember=t.Ember||c().Ember}return n.prototype.setupOnce=function(t,e){var r=this;if(this._Ember){var o=this._Ember.onerror;this._Ember.onerror=function(t){if(e().getIntegration(n)&&e().captureException(t,{originalException:t}),"function"==typeof o)o.call(r._Ember,t);else if(r._Ember.testing)throw t},this._Ember.RSVP.on("error",function(t){e().getIntegration(n)&&e().withScope(function(n){!function(n,t){try{return n instanceof t}catch(n){return!1}}(t,Error)?(n.setExtra("reason",t),e().captureMessage("Unhandled Promise error detected")):(n.setExtra("context","Unhandled Promise error detected"),e().captureException(t,{originalException:t}))})})}else E.error("EmberIntegration is missing an Ember instance")},n.id="Ember",n}();for(var y in t.Ember=d,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},t)Object.prototype.hasOwnProperty.call(t,y)&&(n.Sentry.Integrations[y]=t[y])}(window); | ||
//# sourceMappingURL=ember.min.js.map |
@@ -57,7 +57,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -172,2 +167,11 @@ /** | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
/** | ||
* Checks whether given value's type is a SyntheticEvent | ||
@@ -692,4 +696,2 @@ * {@link isSyntheticEvent}. | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -705,2 +707,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -707,0 +891,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(t){var n={};Object.defineProperty(n,"__esModule",{value:!0});var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(t,n)};var e=function(){return(e=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};var o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var r in n)t.hasOwnProperty(r)||(t[r]=n[r]);return t});!function(t){function n(n){var r=this.constructor,e=t.call(this,n)||this;return e.message=n,e.name=r.prototype.constructor.name,o(e,r.prototype),e}(function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)})(n,t)}(Error);function i(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return f(t,Error)}}function a(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function c(t){return"[object Object]"===Object.prototype.toString.call(t)}function u(t){return"undefined"!=typeof Element&&f(t,Element)}function f(t,n){try{return t instanceof n}catch(t){return!1}}function l(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var p={};function s(){return l()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:p}function y(t){var n=s();if(!("console"in n))return t();var r=n.console,e={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&r[t].__sentry_original__&&(e[t]=r[t],r[t]=r[t].__sentry_original__)});var o=t();return Object.keys(e).forEach(function(t){r[t]=e[t]}),o}function h(t){try{for(var n=t,r=[],e=0,o=0,i=" > ".length,a=void 0;n&&e++<5&&!("html"===(a=g(n))||e>1&&o+r.length*i+a.length>=80);)r.push(a),o+=a.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}function g(t){var n,r,e,o,i,a,c=t,u=[];if(!c||!c.tagName)return"";if(u.push(c.tagName.toLowerCase()),c.id&&u.push("#"+c.id),(n=c.className)&&(a=n,"[object String]"===Object.prototype.toString.call(a)))for(r=n.split(/\s+/),i=0;i<r.length;i++)u.push("."+r[i]);var f=["type","name","title","alt"];for(i=0;i<f.length;i++)e=f[i],(o=c.getAttribute(e))&&u.push("["+e+'="'+o+'"]');return u.join("")}var v=Date.now(),_=0,d={now:function(){var t=Date.now()-v;return t<_&&(t=_),_=t,t},timeOrigin:v},m=(function(){if(l())try{return(t=module,n="perf_hooks",t.require(n)).performance}catch(t){return d}var t,n,r=s().performance;r&&r.now&&(void 0===r.timeOrigin&&(r.timeOrigin=r.timing&&r.timing.navigationStart||v))}(),"<anonymous>");var b=s(),E="Sentry Logger ",O=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&y(function(){b.console.log(E+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&y(function(){b.console.warn(E+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&y(function(){b.console.error(E+"[Error]: "+t.join(" "))})},t}();b.__SENTRY__=b.__SENTRY__||{};var j,w=b.__SENTRY__.logger||(b.__SENTRY__.logger=new O),S=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var n=0;n<this._inner.length;n++){if(this._inner[n]===t)return!0}return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var n=0;n<this._inner.length;n++)if(this._inner[n]===t){this._inner.splice(n,1);break}},t}();function N(t){if(i(t)){var n=t,r={message:n.message,name:n.name,stack:n.stack};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e]);return r}if(c=t,"undefined"!=typeof Event&&f(c,Event)){var o=t,a={};a.type=o.type;try{a.target=u(o.target)?h(o.target):Object.prototype.toString.call(o.target)}catch(t){a.target="<unknown>"}try{a.currentTarget=u(o.currentTarget)?h(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(t){a.currentTarget="<unknown>"}for(var e in"undefined"!=typeof CustomEvent&&f(t,CustomEvent)&&(a.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,e)&&(a[e]=o);return a}var c;return t}function x(t,n){return"domain"===n&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===n?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":c(r=t)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+function(t){try{return t&&"function"==typeof t&&t.name||m}catch(t){return m}}(t)+"]":t;var r}function D(t,n,r,e){if(void 0===r&&(r=1/0),void 0===e&&(e=new S),0===r)return function(t){var n=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===n)return"[Object]";if("[object Array]"===n)return"[Array]";var r=x(t);return a(r)?r:n}(n);if(null!=n&&"function"==typeof n.toJSON)return n.toJSON();var o=x(n,t);if(a(o))return o;var i=N(n),c=Array.isArray(n)?[]:{};if(e.memoize(n))return"[Circular ~]";for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=D(u,i[u],r-1,e));return e.unmemoize(n),c}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(j||(j={}));s();var k=function(){function t(n){void 0===n&&(n={depth:3}),this._options=n,this.name=t.id}return t.prototype.setupOnce=function(n,r){n(function(n,e){var o=r().getIntegration(t);return o?o.enhanceEventWithErrorData(n,e):n})},t.prototype.enhanceEventWithErrorData=function(t,n){var r;if(!n||!n.originalException||!i(n.originalException))return t;var o=n.originalException.name||n.originalException.constructor.name,a=this._extractErrorData(n.originalException);if(a){var u=e({},t.contexts),f=function(t,n){try{return JSON.parse(JSON.stringify(t,function(t,r){return D(t,r,n)}))}catch(t){return"**non-serializable**"}}(a,this._options.depth);return c(f)&&(u=e({},t.contexts,((r={})[o]=e({},f),r))),e({},t,{contexts:u})}return t},t.prototype._extractErrorData=function(t){var n,r,e=null;try{var o=["name","message","stack","line","column","fileName","lineNumber","columnNumber"],a=Object.getOwnPropertyNames(t).filter(function(t){return-1===o.indexOf(t)});if(a.length){var c={};try{for(var u=function(t){var n="function"==typeof Symbol&&t[Symbol.iterator],r=0;return n?n.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}(a),f=u.next();!f.done;f=u.next()){var l=f.value,p=t[l];i(p)&&(p=p.toString()),c[l]=p}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}e=c}}catch(t){w.error("Unable to extract extra data from the Error object:",t)}return e},t.id="ExtraErrorData",t}();for(var P in n.ExtraErrorData=k,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},n)Object.prototype.hasOwnProperty.call(n,P)&&(t.Sentry.Integrations[P]=n[P])}(window); | ||
!function(t){var n={};Object.defineProperty(n,"__esModule",{value:!0});var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};var r=function(){return(r=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};var o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var e in n)t.hasOwnProperty(e)||(t[e]=n[e]);return t});!function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return r.message=n,r.name=e.prototype.constructor.name,o(r,e.prototype),r}(function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)})(n,t)}(Error);function i(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return f(t,Error)}}function a(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function c(t){return"[object Object]"===Object.prototype.toString.call(t)}function u(t){return"undefined"!=typeof Element&&f(t,Element)}function f(t,n){try{return t instanceof n}catch(t){return!1}}function s(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var l={};function p(){return s()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:l}function h(t){var n=p();if(!("console"in n))return t();var e=n.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&e[t].__sentry_original__&&(r[t]=e[t],e[t]=e[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){e[t]=r[t]}),o}function y(t){try{for(var n=t,e=[],r=0,o=0,i=" > ".length,a=void 0;n&&r++<5&&!("html"===(a=_(n))||r>1&&o+e.length*i+a.length>=80);)e.push(a),o+=a.length,n=n.parentNode;return e.reverse().join(" > ")}catch(t){return"<unknown>"}}function _(t){var n,e,r,o,i,a,c=t,u=[];if(!c||!c.tagName)return"";if(u.push(c.tagName.toLowerCase()),c.id&&u.push("#"+c.id),(n=c.className)&&(a=n,"[object String]"===Object.prototype.toString.call(a)))for(e=n.split(/\s+/),i=0;i<e.length;i++)u.push("."+e[i]);var f=["type","name","title","alt"];for(i=0;i<f.length;i++)r=f[i],(o=c.getAttribute(r))&&u.push("["+r+'="'+o+'"]');return u.join("")}var v=Date.now(),d=0,g={now:function(){var t=Date.now()-v;return t<d&&(t=d),d=t,t},timeOrigin:v},E=(function(){if(s())try{return(t=module,n="perf_hooks",t.require(n)).performance}catch(t){return g}var t,n,e=p().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||v))}(),"<anonymous>");var m=p(),b="Sentry Logger ",j=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&h(function(){m.console.log(b+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&h(function(){m.console.warn(b+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&h(function(){m.console.error(b+"[Error]: "+t.join(" "))})},t}();m.__SENTRY__=m.__SENTRY__||{};var O,w=m.__SENTRY__.logger||(m.__SENTRY__.logger=new j),S=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var n=0;n<this._inner.length;n++){if(this._inner[n]===t)return!0}return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var n=0;n<this._inner.length;n++)if(this._inner[n]===t){this._inner.splice(n,1);break}},t}();function N(t){if(i(t)){var n=t,e={message:n.message,name:n.name,stack:n.stack};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}if(c=t,"undefined"!=typeof Event&&f(c,Event)){var o=t,a={};a.type=o.type;try{a.target=u(o.target)?y(o.target):Object.prototype.toString.call(o.target)}catch(t){a.target="<unknown>"}try{a.currentTarget=u(o.currentTarget)?y(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(t){a.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&f(t,CustomEvent)&&(a.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,r)&&(a[r]=o);return a}var c;return t}function D(t,n){return"domain"===n&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===n?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":c(e=t)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+function(t){try{return t&&"function"==typeof t&&t.name||E}catch(t){return E}}(t)+"]":t;var e}function x(t,n,e,r){if(void 0===e&&(e=1/0),void 0===r&&(r=new S),0===e)return function(t){var n=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===n)return"[Object]";if("[object Array]"===n)return"[Array]";var e=D(t);return a(e)?e:n}(n);if(null!=n&&"function"==typeof n.toJSON)return n.toJSON();var o=D(n,t);if(a(o))return o;var i=N(n),c=Array.isArray(n)?[]:{};if(r.memoize(n))return"[Circular ~]";for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=x(u,i[u],e-1,r));return r.unmemoize(n),c}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(O||(O={}));(function(){function t(t){var n=this;this._state=O.PENDING,this._handlers=[],this._resolve=function(t){n._setResult(O.RESOLVED,t)},this._reject=function(t){n._setResult(O.REJECTED,t)},this._setResult=function(t,e){var r;n._state===O.PENDING&&(r=e,Boolean(r&&r.then&&"function"==typeof r.then)?e.then(n._resolve,n._reject):(n._state=t,n._value=e,n._executeHandlers()))},this._attachHandler=function(t){n._handlers=n._handlers.concat(t),n._executeHandlers()},this._executeHandlers=function(){if(n._state!==O.PENDING){var t=n._handlers.slice();n._handlers=[],t.forEach(function(t){t.done||(n._state===O.RESOLVED&&t.onfulfilled&&t.onfulfilled(n._value),n._state===O.REJECTED&&t.onrejected&&t.onrejected(n._value),t.done=!0)})}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}t.prototype.toString=function(){return"[object SyncPromise]"},t.resolve=function(n){return new t(function(t){t(n)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.all=function(n){return new t(function(e,r){if(Array.isArray(n))if(0!==n.length){var o=n.length,i=[];n.forEach(function(n,a){t.resolve(n).then(function(t){i[a]=t,0===(o-=1)&&e(i)}).then(null,r)})}else e([]);else r(new TypeError("Promise.all requires an array as input."))})},t.prototype.then=function(n,e){var r=this;return new t(function(t,o){r._attachHandler({done:!1,onfulfilled:function(e){if(n)try{return void t(n(e))}catch(t){return void o(t)}else t(e)},onrejected:function(n){if(e)try{return void t(e(n))}catch(t){return void o(t)}else o(n)}})})},t.prototype.catch=function(t){return this.then(function(t){return t},t)},t.prototype.finally=function(n){var e=this;return new t(function(t,r){var o,i;return e.then(function(t){i=!1,o=t,n&&n()},function(t){i=!0,o=t,n&&n()}).then(function(){i?r(o):t(o)})})}})(),p();var P=function(){function t(n){void 0===n&&(n={depth:3}),this._options=n,this.name=t.id}return t.prototype.setupOnce=function(n,e){n(function(n,r){var o=e().getIntegration(t);return o?o.enhanceEventWithErrorData(n,r):n})},t.prototype.enhanceEventWithErrorData=function(t,n){var e;if(!n||!n.originalException||!i(n.originalException))return t;var o=n.originalException.name||n.originalException.constructor.name,a=this._extractErrorData(n.originalException);if(a){var u=r({},t.contexts),f=function(t,n){try{return JSON.parse(JSON.stringify(t,function(t,e){return x(t,e,n)}))}catch(t){return"**non-serializable**"}}(a,this._options.depth);return c(f)&&(u=r({},t.contexts,((e={})[o]=r({},f),e))),r({},t,{contexts:u})}return t},t.prototype._extractErrorData=function(t){var n,e,r=null;try{var o=["name","message","stack","line","column","fileName","lineNumber","columnNumber"],a=Object.getOwnPropertyNames(t).filter(function(t){return-1===o.indexOf(t)});if(a.length){var c={};try{for(var u=function(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}(a),f=u.next();!f.done;f=u.next()){var s=f.value,l=t[s];i(l)&&(l=l.toString()),c[s]=l}}catch(t){n={error:t}}finally{try{f&&!f.done&&(e=u.return)&&e.call(u)}finally{if(n)throw n.error}}r=c}}catch(t){w.error("Unable to extract extra data from the Error object:",t)}return r},t.id="ExtraErrorData",t}();for(var k in n.ExtraErrorData=P,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},n)Object.prototype.hasOwnProperty.call(n,k)&&(t.Sentry.Integrations[k]=n[k])}(window); | ||
//# sourceMappingURL=extraerrordata.min.js.map |
@@ -46,7 +46,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -96,2 +91,11 @@ /** | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -260,6 +264,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
/** SyncPromise internal states */ | ||
@@ -275,2 +275,184 @@ var States; | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -325,3 +507,3 @@ /** | ||
this._getCurrentHub = getCurrentHub; | ||
var observer = new (getGlobalObject()).ReportingObserver(this.handler.bind(this), { | ||
var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), { | ||
buffered: true, | ||
@@ -328,0 +510,0 @@ types: this._options.types, |
@@ -1,2 +0,2 @@ | ||
!function(n){var t={};Object.defineProperty(t,"__esModule",{value:!0});var r=function(n,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,t)};var e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var r in t)n.hasOwnProperty(r)||(n[r]=t[r]);return n});!function(n){function t(t){var r=this.constructor,o=n.call(this,t)||this;return o.message=t,o.name=r.prototype.constructor.name,e(o,r.prototype),o}(function(n,t){function e(){this.constructor=n}r(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)})(t,n)}(Error);function o(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var i={};function a(){return o()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function c(n){var t=a();if(!("console"in t))return n();var r=t.console,e={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&r[n].__sentry_original__&&(e[n]=r[n],r[n]=r[n].__sentry_original__)});var o=n();return Object.keys(e).forEach(function(n){r[n]=e[n]}),o}var s=Date.now(),u=0,f={now:function(){var n=Date.now()-s;return n<u&&(n=u),u=n,n},timeOrigin:s},p=(function(){if(o())try{return(n=module,t="perf_hooks",n.require(t)).performance}catch(n){return f}var n,t,r=a().performance;r&&r.now&&(void 0===r.timeOrigin&&(r.timeOrigin=r.timing&&r.timing.navigationStart||s))}(),a()),l="Sentry Logger ",_=function(){function n(){this._enabled=!1}return n.prototype.disable=function(){this._enabled=!1},n.prototype.enable=function(){this._enabled=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&c(function(){p.console.log(l+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&c(function(){p.console.warn(l+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._enabled&&c(function(){p.console.error(l+"[Error]: "+n.join(" "))})},n}();p.__SENTRY__=p.__SENTRY__||{};var y;p.__SENTRY__.logger||(p.__SENTRY__.logger=new _);!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(y||(y={}));var v;a();!function(n){n.Crash="crash",n.Deprecation="deprecation",n.Intervention="intervention"}(v||(v={}));var d=function(){function n(t){void 0===t&&(t={types:[v.Crash,v.Deprecation,v.Intervention]}),this._options=t,this.name=n.id}return n.prototype.setupOnce=function(n,t){"ReportingObserver"in a()&&(this._getCurrentHub=t,new(a().ReportingObserver)(this.handler.bind(this),{buffered:!0,types:this._options.types}).observe())},n.prototype.handler=function(t){var r,e,o=this._getCurrentHub&&this._getCurrentHub();if(o&&o.getIntegration(n)){var i=function(n){o.withScope(function(t){t.setExtra("url",n.url);var r="ReportingObserver ["+n.type+"]",e="No details available";if(n.body){var i,a={};for(var c in n.body)a[c]=n.body[c];if(t.setExtra("body",a),n.type===v.Crash)e=[(i=n.body).crashId||"",i.reason||""].join(" ").trim()||e;else e=(i=n.body).message||e}o.captureMessage(r+": "+e)})};try{for(var a=function(n){var t="function"==typeof Symbol&&n[Symbol.iterator],r=0;return t?t.call(n):{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}}}(t),c=a.next();!c.done;c=a.next()){i(c.value)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(r)throw r.error}}}},n.id="ReportingObserver",n}();for(var g in t.ReportingObserver=d,n.Sentry=n.Sentry||{},n.Sentry.Integrations=n.Sentry.Integrations||{},t)Object.prototype.hasOwnProperty.call(t,g)&&(n.Sentry.Integrations[g]=t[g])}(window); | ||
!function(t){var n={};Object.defineProperty(n,"__esModule",{value:!0});var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};var r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var e in n)t.hasOwnProperty(e)||(t[e]=n[e]);return t});!function(t){function n(n){var e=this.constructor,o=t.call(this,n)||this;return o.message=n,o.name=e.prototype.constructor.name,r(o,e.prototype),o}(function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)})(n,t)}(Error);function o(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var i={};function a(){return o()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function c(t){var n=a();if(!("console"in n))return t();var e=n.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&e[t].__sentry_original__&&(r[t]=e[t],e[t]=e[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){e[t]=r[t]}),o}var u=Date.now(),s=0,f={now:function(){var t=Date.now()-u;return t<s&&(t=s),s=t,t},timeOrigin:u},l=(function(){if(o())try{return(t=module,n="perf_hooks",t.require(n)).performance}catch(t){return f}var t,n,e=a().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||u))}(),a()),_="Sentry Logger ",h=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&c(function(){l.console.log(_+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&c(function(){l.console.warn(_+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&c(function(){l.console.error(_+"[Error]: "+t.join(" "))})},t}();l.__SENTRY__=l.__SENTRY__||{};var p;l.__SENTRY__.logger||(l.__SENTRY__.logger=new h);!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(p||(p={}));!function(){function t(t){var n=this;this._state=p.PENDING,this._handlers=[],this._resolve=function(t){n._setResult(p.RESOLVED,t)},this._reject=function(t){n._setResult(p.REJECTED,t)},this._setResult=function(t,e){var r;n._state===p.PENDING&&(r=e,Boolean(r&&r.then&&"function"==typeof r.then)?e.then(n._resolve,n._reject):(n._state=t,n._value=e,n._executeHandlers()))},this._attachHandler=function(t){n._handlers=n._handlers.concat(t),n._executeHandlers()},this._executeHandlers=function(){if(n._state!==p.PENDING){var t=n._handlers.slice();n._handlers=[],t.forEach(function(t){t.done||(n._state===p.RESOLVED&&t.onfulfilled&&t.onfulfilled(n._value),n._state===p.REJECTED&&t.onrejected&&t.onrejected(n._value),t.done=!0)})}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}t.prototype.toString=function(){return"[object SyncPromise]"},t.resolve=function(n){return new t(function(t){t(n)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.all=function(n){return new t(function(e,r){if(Array.isArray(n))if(0!==n.length){var o=n.length,i=[];n.forEach(function(n,a){t.resolve(n).then(function(t){i[a]=t,0===(o-=1)&&e(i)}).then(null,r)})}else e([]);else r(new TypeError("Promise.all requires an array as input."))})},t.prototype.then=function(n,e){var r=this;return new t(function(t,o){r._attachHandler({done:!1,onfulfilled:function(e){if(n)try{return void t(n(e))}catch(t){return void o(t)}else t(e)},onrejected:function(n){if(e)try{return void t(e(n))}catch(t){return void o(t)}else o(n)}})})},t.prototype.catch=function(t){return this.then(function(t){return t},t)},t.prototype.finally=function(n){var e=this;return new t(function(t,r){var o,i;return e.then(function(t){i=!1,o=t,n&&n()},function(t){i=!0,o=t,n&&n()}).then(function(){i?r(o):t(o)})})}}();var y;a();!function(t){t.Crash="crash",t.Deprecation="deprecation",t.Intervention="intervention"}(y||(y={}));var d=function(){function t(n){void 0===n&&(n={types:[y.Crash,y.Deprecation,y.Intervention]}),this._options=n,this.name=t.id}return t.prototype.setupOnce=function(t,n){"ReportingObserver"in a()&&(this._getCurrentHub=n,new(a().ReportingObserver)(this.handler.bind(this),{buffered:!0,types:this._options.types}).observe())},t.prototype.handler=function(n){var e,r,o=this._getCurrentHub&&this._getCurrentHub();if(o&&o.getIntegration(t)){var i=function(t){o.withScope(function(n){n.setExtra("url",t.url);var e="ReportingObserver ["+t.type+"]",r="No details available";if(t.body){var i,a={};for(var c in t.body)a[c]=t.body[c];if(n.setExtra("body",a),t.type===y.Crash)r=[(i=t.body).crashId||"",i.reason||""].join(" ").trim()||r;else r=(i=t.body).message||r}o.captureMessage(e+": "+r)})};try{for(var a=function(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}(n),c=a.next();!c.done;c=a.next()){i(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}},t.id="ReportingObserver",t}();for(var v in n.ReportingObserver=d,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},n)Object.prototype.hasOwnProperty.call(n,v)&&(t.Sentry.Integrations[v]=n[v])}(window); | ||
//# sourceMappingURL=reportingobserver.min.js.map |
@@ -46,7 +46,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -96,2 +91,11 @@ /** | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -260,4 +264,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
@@ -386,2 +388,184 @@ // https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -388,0 +572,0 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ |
@@ -1,2 +0,2 @@ | ||
!function(t){var r={};Object.defineProperty(r,"__esModule",{value:!0});var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};var n=function(){return(n=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,r){return t.__proto__=r,t}:function(t,r){for(var e in r)t.hasOwnProperty(e)||(t[e]=r[e]);return t});!function(t){function r(r){var e=this.constructor,n=t.call(this,r)||this;return n.message=r,n.name=e.prototype.constructor.name,o(n,e.prototype),n}(function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)})(r,t)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var a={};function c(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:a}function s(t){var r=c();if(!("console"in r))return t();var e=r.console,n={};["debug","info","warn","error","log","assert"].forEach(function(t){t in r.console&&e[t].__sentry_original__&&(n[t]=e[t],e[t]=e[t].__sentry_original__)});var o=t();return Object.keys(n).forEach(function(t){e[t]=n[t]}),o}var u=Date.now(),f=0,p={now:function(){var t=Date.now()-u;return t<f&&(t=f),f=t,t},timeOrigin:u},l=(function(){if(i())try{return(t=module,r="perf_hooks",t.require(r)).performance}catch(t){return p}var t,r,e=c().performance;e&&e.now&&(void 0===e.timeOrigin&&(e.timeOrigin=e.timing&&e.timing.navigationStart||u))}(),c()),_="Sentry Logger ",h=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&s(function(){l.console.log(_+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&s(function(){l.console.warn(_+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&s(function(){l.console.error(_+"[Error]: "+t.join(" "))})},t}();l.__SENTRY__=l.__SENTRY__||{};l.__SENTRY__.logger||(l.__SENTRY__.logger=new h);var v,y=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function g(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e="",n=!1,o=t.length-1;o>=-1&&!n;o--){var i=o>=0?t[o]:"/";i&&(e=i+"/"+e,n="/"===i.charAt(0))}return(n?"/":"")+(e=function(t,r){for(var e=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(r)for(;e--;e)t.unshift("..");return t}(e.split("/").filter(function(t){return!!t}),!n).join("/"))||"."}function m(t){for(var r=0;r<t.length&&""===t[r];r++);for(var e=t.length-1;e>=0&&""===t[e];e--);return r>e?[]:t.slice(r,e-r+1)}function E(t,r){var e,n,o=(e=t,n=y.exec(e),n?n.slice(1):[])[2];return r&&o.substr(-1*r.length)===r&&(o=o.substr(0,o.length-r.length)),o}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(v||(v={}));c();var b=function(){function t(r){var e=this;void 0===r&&(r={}),this.name=t.id,this._iteratee=function(t){if(!t.filename)return t;var r=/^[A-Z]:\\/.test(t.filename),n=/^\//.test(t.filename);if(r||n){var o=r?t.filename.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):t.filename,i=e._root?function(t,r){t=g(t).substr(1),r=g(r).substr(1);for(var e=m(t.split("/")),n=m(r.split("/")),o=Math.min(e.length,n.length),i=o,a=0;a<o;a++)if(e[a]!==n[a]){i=a;break}var c=[];for(a=i;a<e.length;a++)c.push("..");return(c=c.concat(n.slice(i))).join("/")}(e._root,o):E(o);t.filename="app:///"+i}return t},r.root&&(this._root=r.root),r.iteratee&&(this._iteratee=r.iteratee)}return t.prototype.setupOnce=function(r,e){r(function(r){var n=e().getIntegration(t);return n?n.process(r):r})},t.prototype.process=function(t){return t.exception&&Array.isArray(t.exception.values)?this._processExceptionsEvent(t):t.stacktrace?this._processStacktraceEvent(t):t},t.prototype._processExceptionsEvent=function(t){var r=this;try{return n({},t,{exception:n({},t.exception,{values:t.exception.values.map(function(t){return n({},t,{stacktrace:r._processStacktrace(t.stacktrace)})})})})}catch(r){return t}},t.prototype._processStacktraceEvent=function(t){try{return n({},t,{stacktrace:this._processStacktrace(t.stacktrace)})}catch(r){return t}},t.prototype._processStacktrace=function(t){var r=this;return n({},t,{frames:t&&t.frames&&t.frames.map(function(t){return r._iteratee(t)})})},t.id="RewriteFrames",t}();for(var d in r.RewriteFrames=b,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},r)Object.prototype.hasOwnProperty.call(r,d)&&(t.Sentry.Integrations[d]=r[d])}(window); | ||
!function(t){var e={};Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t});!function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,o(r,n.prototype),r}(function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t)}(Error);function i(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var c={};function a(){return i()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:c}function s(t){var e=a();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){n[t]=r[t]}),o}var u=Date.now(),f=0,l={now:function(){var t=Date.now()-u;return t<f&&(t=f),f=t,t},timeOrigin:u},p=(function(){if(i())try{return(t=module,e="perf_hooks",t.require(e)).performance}catch(t){return l}var t,e,n=a().performance;n&&n.now&&(void 0===n.timeOrigin&&(n.timeOrigin=n.timing&&n.timing.navigationStart||u))}(),a()),_="Sentry Logger ",h=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){p.console.log(_+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){p.console.warn(_+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&s(function(){p.console.error(_+"[Error]: "+t.join(" "))})},t}();p.__SENTRY__=p.__SENTRY__||{};p.__SENTRY__.logger||(p.__SENTRY__.logger=new h);var v,y=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function d(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",r=!1,o=t.length-1;o>=-1&&!r;o--){var i=o>=0?t[o]:"/";i&&(n=i+"/"+n,r="/"===i.charAt(0))}return(r?"/":"")+(n=function(t,e){for(var n=0,r=t.length-1;r>=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}(n.split("/").filter(function(t){return!!t}),!r).join("/"))||"."}function g(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}function E(t,e){var n,r,o=(n=t,r=y.exec(n),r?r.slice(1):[])[2];return e&&o.substr(-1*e.length)===e&&(o=o.substr(0,o.length-e.length)),o}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(v||(v={}));(function(){function t(t){var e=this;this._state=v.PENDING,this._handlers=[],this._resolve=function(t){e._setResult(v.RESOLVED,t)},this._reject=function(t){e._setResult(v.REJECTED,t)},this._setResult=function(t,n){var r;e._state===v.PENDING&&(r=n,Boolean(r&&r.then&&"function"==typeof r.then)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==v.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach(function(t){t.done||(e._state===v.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._value),e._state===v.REJECTED&&t.onrejected&&t.onrejected(e._value),t.done=!0)})}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}t.prototype.toString=function(){return"[object SyncPromise]"},t.resolve=function(e){return new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.all=function(e){return new t(function(n,r){if(Array.isArray(e))if(0!==e.length){var o=e.length,i=[];e.forEach(function(e,c){t.resolve(e).then(function(t){i[c]=t,0===(o-=1)&&n(i)}).then(null,r)})}else n([]);else r(new TypeError("Promise.all requires an array as input."))})},t.prototype.then=function(e,n){var r=this;return new t(function(t,o){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void o(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void o(t)}else o(e)}})})},t.prototype.catch=function(t){return this.then(function(t){return t},t)},t.prototype.finally=function(e){var n=this;return new t(function(t,r){var o,i;return n.then(function(t){i=!1,o=t,e&&e()},function(t){i=!0,o=t,e&&e()}).then(function(){i?r(o):t(o)})})}})(),a();var m=function(){function t(e){var n=this;void 0===e&&(e={}),this.name=t.id,this._iteratee=function(t){if(!t.filename)return t;var e=/^[A-Z]:\\/.test(t.filename),r=/^\//.test(t.filename);if(e||r){var o=e?t.filename.replace(/^[A-Z]:/,"").replace(/\\/g,"/"):t.filename,i=n._root?function(t,e){t=d(t).substr(1),e=d(e).substr(1);for(var n=g(t.split("/")),r=g(e.split("/")),o=Math.min(n.length,r.length),i=o,c=0;c<o;c++)if(n[c]!==r[c]){i=c;break}var a=[];for(c=i;c<n.length;c++)a.push("..");return(a=a.concat(r.slice(i))).join("/")}(n._root,o):E(o);t.filename="app:///"+i}return t},e.root&&(this._root=e.root),e.iteratee&&(this._iteratee=e.iteratee)}return t.prototype.setupOnce=function(e,n){e(function(e){var r=n().getIntegration(t);return r?r.process(e):e})},t.prototype.process=function(t){return t.exception&&Array.isArray(t.exception.values)?this._processExceptionsEvent(t):t.stacktrace?this._processStacktraceEvent(t):t},t.prototype._processExceptionsEvent=function(t){var e=this;try{return r({},t,{exception:r({},t.exception,{values:t.exception.values.map(function(t){return r({},t,{stacktrace:e._processStacktrace(t.stacktrace)})})})})}catch(e){return t}},t.prototype._processStacktraceEvent=function(t){try{return r({},t,{stacktrace:this._processStacktrace(t.stacktrace)})}catch(e){return t}},t.prototype._processStacktrace=function(t){var e=this;return r({},t,{frames:t&&t.frames&&t.frames.map(function(t){return e._iteratee(t)})})},t.id="RewriteFrames",t}();for(var w in e.RewriteFrames=m,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},e)Object.prototype.hasOwnProperty.call(e,w)&&(t.Sentry.Integrations[w]=e[w])}(window); | ||
//# sourceMappingURL=rewriteframes.min.js.map |
238
build/vue.js
@@ -69,7 +69,2 @@ (function (__window) { | ||
/** | ||
* Consumes the promise and logs the error when it rejects. | ||
* @param promise A promise to forget. | ||
*/ | ||
var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method | ||
@@ -119,2 +114,11 @@ /** | ||
*/ | ||
/** | ||
* Checks whether given value has a then function. | ||
* @param wat A value to be checked. | ||
*/ | ||
function isThenable(wat) { | ||
// tslint:disable:no-unsafe-any | ||
return Boolean(wat && wat.then && typeof wat.then === 'function'); | ||
// tslint:enable:no-unsafe-any | ||
} | ||
@@ -289,4 +293,2 @@ /** | ||
// tslint:disable:no-unsafe-any | ||
// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript | ||
@@ -320,2 +322,184 @@ // Split a filename into [root, dir, basename, ext], unix version | ||
})(States || (States = {})); | ||
/** | ||
* Thenable class that behaves like a Promise and follows it's interface | ||
* but is not async internally | ||
*/ | ||
var SyncPromise = /** @class */ (function () { | ||
function SyncPromise(executor) { | ||
var _this = this; | ||
this._state = States.PENDING; | ||
this._handlers = []; | ||
/** JSDoc */ | ||
this._resolve = function (value) { | ||
_this._setResult(States.RESOLVED, value); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(States.REJECTED, reason); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (state, value) { | ||
if (_this._state !== States.PENDING) { | ||
return; | ||
} | ||
if (isThenable(value)) { | ||
value.then(_this._resolve, _this._reject); | ||
return; | ||
} | ||
_this._state = state; | ||
_this._value = value; | ||
_this._executeHandlers(); | ||
}; | ||
// TODO: FIXME | ||
/** JSDoc */ | ||
this._attachHandler = function (handler) { | ||
_this._handlers = _this._handlers.concat(handler); | ||
_this._executeHandlers(); | ||
}; | ||
/** JSDoc */ | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
return; | ||
} | ||
var cachedHandlers = _this._handlers.slice(); | ||
_this._handlers = []; | ||
cachedHandlers.forEach(function (handler) { | ||
if (handler.done) { | ||
return; | ||
} | ||
if (_this._state === States.RESOLVED) { | ||
if (handler.onfulfilled) { | ||
handler.onfulfilled(_this._value); | ||
} | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (handler.onrejected) { | ||
handler.onrejected(_this._value); | ||
} | ||
} | ||
handler.done = true; | ||
}); | ||
}; | ||
try { | ||
executor(this._resolve, this._reject); | ||
} | ||
catch (e) { | ||
this._reject(e); | ||
} | ||
} | ||
/** JSDoc */ | ||
SyncPromise.prototype.toString = function () { | ||
return '[object SyncPromise]'; | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.resolve = function (value) { | ||
return new SyncPromise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.reject = function (reason) { | ||
return new SyncPromise(function (_, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.all = function (collection) { | ||
return new SyncPromise(function (resolve, reject) { | ||
if (!Array.isArray(collection)) { | ||
reject(new TypeError("Promise.all requires an array as input.")); | ||
return; | ||
} | ||
if (collection.length === 0) { | ||
resolve([]); | ||
return; | ||
} | ||
var counter = collection.length; | ||
var resolvedCollection = []; | ||
collection.forEach(function (item, index) { | ||
SyncPromise.resolve(item) | ||
.then(function (value) { | ||
resolvedCollection[index] = value; | ||
counter -= 1; | ||
if (counter !== 0) { | ||
return; | ||
} | ||
resolve(resolvedCollection); | ||
}) | ||
.then(null, reject); | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.then = function (onfulfilled, onrejected) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
_this._attachHandler({ | ||
done: false, | ||
onfulfilled: function (result) { | ||
if (!onfulfilled) { | ||
// TODO: ¯\_(ツ)_/¯ | ||
// TODO: FIXME | ||
resolve(result); | ||
return; | ||
} | ||
try { | ||
resolve(onfulfilled(result)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
onrejected: function (reason) { | ||
if (!onrejected) { | ||
reject(reason); | ||
return; | ||
} | ||
try { | ||
resolve(onrejected(reason)); | ||
return; | ||
} | ||
catch (e) { | ||
reject(e); | ||
return; | ||
} | ||
}, | ||
}); | ||
}); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.catch = function (onrejected) { | ||
return this.then(function (val) { return val; }, onrejected); | ||
}; | ||
/** JSDoc */ | ||
SyncPromise.prototype.finally = function (onfinally) { | ||
var _this = this; | ||
return new SyncPromise(function (resolve, reject) { | ||
var val; | ||
var isRejected; | ||
return _this.then(function (value) { | ||
isRejected = false; | ||
val = value; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}, function (reason) { | ||
isRejected = true; | ||
val = reason; | ||
if (onfinally) { | ||
onfinally(); | ||
} | ||
}).then(function () { | ||
if (isRejected) { | ||
reject(val); | ||
return; | ||
} | ||
resolve(val); | ||
}); | ||
}); | ||
}; | ||
return SyncPromise; | ||
}()); | ||
@@ -328,2 +512,3 @@ /* tslint:disable:only-arrow-functions no-unsafe-any */ | ||
* without the need to import `Tracing` itself from the @sentry/apm package. | ||
* @deprecated as @sentry/tracing should be used over @sentry/apm. | ||
*/ | ||
@@ -333,2 +518,8 @@ var TRACING_GETTER = { | ||
}; | ||
/** | ||
* Used to extract BrowserTracing integration from @sentry/tracing | ||
*/ | ||
var BROWSER_TRACING_GETTER = { | ||
id: 'BrowserTracing', | ||
}; | ||
// Mappings from operation to corresponding lifecycle hook. | ||
@@ -388,2 +579,3 @@ var HOOKS = { | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -402,3 +594,13 @@ if (tracingIntegration) { | ||
} | ||
// Use functionality from @sentry/tracing | ||
} | ||
else { | ||
var activeTransaction = getActiveTransaction(getCurrentHub()); | ||
if (activeTransaction) { | ||
_this._rootSpan = activeTransaction.startChild({ | ||
description: 'Application Render', | ||
op: 'Vue', | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -503,2 +705,3 @@ } | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -508,7 +711,8 @@ if (tracingIntegration) { | ||
tracingIntegration.constructor.popActivity(_this._tracingActivity); | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
} | ||
} | ||
// We should always finish the span, only should pop activity if using @sentry/apm | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
}, this._options.tracingOptions.timeout); | ||
@@ -521,3 +725,4 @@ }; | ||
beforeCreate: function () { | ||
if (getCurrentHub().getIntegration(TRACING_GETTER)) { | ||
// tslint:disable-next-line: deprecation | ||
if (getCurrentHub().getIntegration(TRACING_GETTER) || getCurrentHub().getIntegration(BROWSER_TRACING_GETTER)) { | ||
// `this` points to currently rendered component | ||
@@ -591,4 +796,15 @@ applyTracingHooks(this, getCurrentHub); | ||
}()); | ||
/** Grabs active transaction off scope */ | ||
function getActiveTransaction(hub) { | ||
if (hub && hub.getScope) { | ||
var scope = hub.getScope(); | ||
if (scope) { | ||
return scope.getTransaction(); | ||
} | ||
} | ||
return undefined; | ||
} | ||
exports.Vue = Vue; | ||
exports.getActiveTransaction = getActiveTransaction; | ||
@@ -595,0 +811,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t){var o={};Object.defineProperty(o,"__esModule",{value:!0});var n=function(t,o){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])})(t,o)};var r=function(){return(r=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++)for(var e in o=arguments[n])Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e]);return t}).apply(this,arguments)};function e(t,o){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,e,i=n.call(t),a=[];try{for(;(void 0===o||o-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return a}var i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,o){return t.__proto__=o,t}:function(t,o){for(var n in o)t.hasOwnProperty(n)||(t[n]=o[n]);return t});!function(t){function o(o){var n=this.constructor,r=t.call(this,o)||this;return r.message=o,r.name=n.prototype.constructor.name,i(r,n.prototype),r}(function(t,o){function r(){this.constructor=t}n(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)})(o,t)}(Error);function a(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var c={};function s(){return a()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:c}function p(t){var o=s();if(!("console"in o))return t();var n=o.console,r={};["debug","info","warn","error","log","assert"].forEach(function(t){t in o.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)});var e=t();return Object.keys(r).forEach(function(t){n[t]=r[t]}),e}var u=Date.now(),f=0,_={now:function(){var t=Date.now()-u;return t<f&&(t=f),f=t,t},timeOrigin:u},l=function(){if(a())try{return(t=module,o="perf_hooks",t.require(o)).performance}catch(t){return _}var t,o,n=s().performance;return n&&n.now?(void 0===n.timeOrigin&&(n.timeOrigin=n.timing&&n.timing.navigationStart||u),n):_}();function g(){return(l.timeOrigin+l.now())/1e3}var h=s(),y="Sentry Logger ",v=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&p(function(){h.console.log(y+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&p(function(){h.console.warn(y+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._enabled&&p(function(){h.console.error(y+"[Error]: "+t.join(" "))})},t}();h.__SENTRY__=h.__SENTRY__||{};var d,m=h.__SENTRY__.logger||(h.__SENTRY__.logger=new v),b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function S(t,o){var n,r,e=(n=t,r=b.exec(n),r?r.slice(1):[])[2];return o&&e.substr(-1*o.length)===o&&(e=e.substr(0,e.length-o.length)),e}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(d||(d={}));s();var O={id:"Tracing"},E={activate:["activated","deactivated"],create:["beforeCreate","created"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]},w=/(?:^|[-_/])(\w)/g,T="root",V=function(){function t(o){var n=this;this.name=t.id,this._componentsCache={},this._applyTracingHooks=function(t,o){if(!t.$options.$_sentryPerfHook){t.$options.$_sentryPerfHook=!0;var r=n._getComponentName(t),i=r===T,a={};n._options.tracingOptions.hooks.forEach(function(c){var s=E[c];s?s.forEach(function(s){var p=i?function(r){var e=g();n._rootSpan?n._finishRootSpan(e,o):t.$once("hook:"+r,function(){var t=o().getIntegration(O);if(t){n._tracingActivity=t.constructor.pushActivity("Vue Application Render");var r=t.constructor.getTransaction();r&&(n._rootSpan=r.startChild({description:"Application Render",op:"Vue"}))}})}.bind(n,s):function(e,i){var c=Array.isArray(n._options.tracingOptions.trackComponents)?n._options.tracingOptions.trackComponents.indexOf(r)>-1:n._options.tracingOptions.trackComponents;if(n._rootSpan&&c){var s=g(),p=a[i];p?(p.finish(),n._finishRootSpan(s,o)):t.$once("hook:"+e,function(){n._rootSpan&&(a[i]=n._rootSpan.startChild({description:"Vue <"+r+">",op:i}))})}}.bind(n,s,c),u=t.$options[s];Array.isArray(u)?t.$options[s]=function(){for(var t=[],o=0;o<arguments.length;o++)t=t.concat(e(arguments[o]));return t}([p],u):t.$options[s]="function"==typeof u?[p,u]:[p]}):m.warn("Unknown hook: "+c)})}},this._options=r({Vue:s().Vue,attachProps:!0,logErrors:!1,tracing:!1},o,{tracingOptions:r({hooks:["mount","update"],timeout:2e3,trackComponents:!1},o.tracingOptions)})}return t.prototype._getComponentName=function(t){if(!t)return"anonymous component";if(t.$root===t)return T;if(!t.$options)return"anonymous component";if(t.$options.name)return t.$options.name;if(t.$options._componentTag)return t.$options._componentTag;if(t.$options.__file){var o=S(t.$options.__file.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"),".vue");return this._componentsCache[o]||(this._componentsCache[o]=o.replace(w,function(t,o){return o?o.toUpperCase():""}))}return"anonymous component"},t.prototype._finishRootSpan=function(t,o){var n=this;this._rootSpanTimer&&clearTimeout(this._rootSpanTimer),this._rootSpanTimer=setTimeout(function(){if(n._tracingActivity){var r=o().getIntegration(O);r&&(r.constructor.popActivity(n._tracingActivity),n._rootSpan&&n._rootSpan.finish(t))}},this._options.tracingOptions.timeout)},t.prototype._startTracing=function(t){var o=this._applyTracingHooks;this._options.Vue.mixin({beforeCreate:function(){t().getIntegration(O)?o(this,t):m.error("Vue integration has tracing enabled, but Tracing integration is not configured")}})},t.prototype._attachErrorHandler=function(o){var n=this,r=this._options.Vue.config.errorHandler;this._options.Vue.config.errorHandler=function(e,i,a){var c={};if(i)try{c.componentName=n._getComponentName(i),n._options.attachProps&&(c.propsData=i.$options.propsData)}catch(t){m.warn("Unable to extract metadata from Vue component.")}a&&(c.lifecycleHook=a),o().getIntegration(t)&&setTimeout(function(){o().withScope(function(t){t.setContext("vue",c),o().captureException(e)})}),"function"==typeof r&&r.call(n._options.Vue,e,i,a),n._options.logErrors&&(n._options.Vue.util&&n._options.Vue.util.warn("Error in "+a+': "'+e.toString()+'"',i),console.error(e))}},t.prototype.setupOnce=function(t,o){this._options.Vue?(this._attachErrorHandler(o),this._options.tracing&&this._startTracing(o)):m.error("Vue integration is missing a Vue instance")},t.id="Vue",t}();for(var $ in o.Vue=V,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},o)Object.prototype.hasOwnProperty.call(o,$)&&(t.Sentry.Integrations[$]=o[$])}(window); | ||
!function(t){var n={};Object.defineProperty(n,"__esModule",{value:!0});var o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])})(t,n)};var e=function(){return(e=Object.assign||function(t){for(var n,o=1,e=arguments.length;o<e;o++)for(var r in n=arguments[o])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function r(t,n){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var e,r,i=o.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(e=i.next()).done;)a.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return a}var i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var o in n)t.hasOwnProperty(o)||(t[o]=n[o]);return t});!function(t){function n(n){var o=this.constructor,e=t.call(this,n)||this;return e.message=n,e.name=o.prototype.constructor.name,i(e,o.prototype),e}(function(t,n){function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)})(n,t)}(Error);function a(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var c={};function s(){return a()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:c}function u(t){var n=s();if(!("console"in n))return t();var o=n.console,e={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&o[t].__sentry_original__&&(e[t]=o[t],o[t]=o[t].__sentry_original__)});var r=t();return Object.keys(e).forEach(function(t){o[t]=e[t]}),r}var p=Date.now(),f=0,l={now:function(){var t=Date.now()-p;return t<f&&(t=f),f=t,t},timeOrigin:p},_=function(){if(a())try{return(t=module,n="perf_hooks",t.require(n)).performance}catch(t){return l}var t,n,o=s().performance;return o&&o.now?(void 0===o.timeOrigin&&(o.timeOrigin=o.timing&&o.timing.navigationStart||p),o):l}();function h(){return(_.timeOrigin+_.now())/1e3}var g=s(),y="Sentry Logger ",d=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&u(function(){g.console.log(y+"[Log]: "+t.join(" "))})},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&u(function(){g.console.warn(y+"[Warn]: "+t.join(" "))})},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._enabled&&u(function(){g.console.error(y+"[Error]: "+t.join(" "))})},t}();g.__SENTRY__=g.__SENTRY__||{};var v,m=g.__SENTRY__.logger||(g.__SENTRY__.logger=new d),E=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function S(t,n){var o,e,r=(o=t,e=E.exec(o),e?e.slice(1):[])[2];return n&&r.substr(-1*n.length)===n&&(r=r.substr(0,r.length-n.length)),r}!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(v||(v={}));(function(){function t(t){var n=this;this._state=v.PENDING,this._handlers=[],this._resolve=function(t){n._setResult(v.RESOLVED,t)},this._reject=function(t){n._setResult(v.REJECTED,t)},this._setResult=function(t,o){var e;n._state===v.PENDING&&(e=o,Boolean(e&&e.then&&"function"==typeof e.then)?o.then(n._resolve,n._reject):(n._state=t,n._value=o,n._executeHandlers()))},this._attachHandler=function(t){n._handlers=n._handlers.concat(t),n._executeHandlers()},this._executeHandlers=function(){if(n._state!==v.PENDING){var t=n._handlers.slice();n._handlers=[],t.forEach(function(t){t.done||(n._state===v.RESOLVED&&t.onfulfilled&&t.onfulfilled(n._value),n._state===v.REJECTED&&t.onrejected&&t.onrejected(n._value),t.done=!0)})}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}t.prototype.toString=function(){return"[object SyncPromise]"},t.resolve=function(n){return new t(function(t){t(n)})},t.reject=function(n){return new t(function(t,o){o(n)})},t.all=function(n){return new t(function(o,e){if(Array.isArray(n))if(0!==n.length){var r=n.length,i=[];n.forEach(function(n,a){t.resolve(n).then(function(t){i[a]=t,0===(r-=1)&&o(i)}).then(null,e)})}else o([]);else e(new TypeError("Promise.all requires an array as input."))})},t.prototype.then=function(n,o){var e=this;return new t(function(t,r){e._attachHandler({done:!1,onfulfilled:function(o){if(n)try{return void t(n(o))}catch(t){return void r(t)}else t(o)},onrejected:function(n){if(o)try{return void t(o(n))}catch(t){return void r(t)}else r(n)}})})},t.prototype.catch=function(t){return this.then(function(t){return t},t)},t.prototype.finally=function(n){var o=this;return new t(function(t,e){var r,i;return o.then(function(t){i=!1,r=t,n&&n()},function(t){i=!0,r=t,n&&n()}).then(function(){i?e(r):t(r)})})}})(),s();var b={id:"Tracing"},w={id:"BrowserTracing"},O={activate:["activated","deactivated"],create:["beforeCreate","created"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]},T=/(?:^|[-_/])(\w)/g,V="root",j=function(){function t(n){var o=this;this.name=t.id,this._componentsCache={},this._applyTracingHooks=function(t,n){if(!t.$options.$_sentryPerfHook){t.$options.$_sentryPerfHook=!0;var e=o._getComponentName(t),i=e===V,a={};o._options.tracingOptions.hooks.forEach(function(c){var s=O[c];s?s.forEach(function(s){var u=i?function(e){var r=h();o._rootSpan?o._finishRootSpan(r,n):t.$once("hook:"+e,function(){var t=n().getIntegration(b);if(t){o._tracingActivity=t.constructor.pushActivity("Vue Application Render");var e=t.constructor.getTransaction();e&&(o._rootSpan=e.startChild({description:"Application Render",op:"Vue"}))}else{var r=C(n());r&&(o._rootSpan=r.startChild({description:"Application Render",op:"Vue"}))}})}.bind(o,s):function(r,i){var c=Array.isArray(o._options.tracingOptions.trackComponents)?o._options.tracingOptions.trackComponents.indexOf(e)>-1:o._options.tracingOptions.trackComponents;if(o._rootSpan&&c){var s=h(),u=a[i];u?(u.finish(),o._finishRootSpan(s,n)):t.$once("hook:"+r,function(){o._rootSpan&&(a[i]=o._rootSpan.startChild({description:"Vue <"+e+">",op:i}))})}}.bind(o,s,c),p=t.$options[s];Array.isArray(p)?t.$options[s]=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(r(arguments[n]));return t}([u],p):t.$options[s]="function"==typeof p?[u,p]:[u]}):m.warn("Unknown hook: "+c)})}},this._options=e({Vue:s().Vue,attachProps:!0,logErrors:!1,tracing:!1},n,{tracingOptions:e({hooks:["mount","update"],timeout:2e3,trackComponents:!1},n.tracingOptions)})}return t.prototype._getComponentName=function(t){if(!t)return"anonymous component";if(t.$root===t)return V;if(!t.$options)return"anonymous component";if(t.$options.name)return t.$options.name;if(t.$options._componentTag)return t.$options._componentTag;if(t.$options.__file){var n=S(t.$options.__file.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"),".vue");return this._componentsCache[n]||(this._componentsCache[n]=n.replace(T,function(t,n){return n?n.toUpperCase():""}))}return"anonymous component"},t.prototype._finishRootSpan=function(t,n){var o=this;this._rootSpanTimer&&clearTimeout(this._rootSpanTimer),this._rootSpanTimer=setTimeout(function(){if(o._tracingActivity){var e=n().getIntegration(b);e&&e.constructor.popActivity(o._tracingActivity)}o._rootSpan&&o._rootSpan.finish(t)},this._options.tracingOptions.timeout)},t.prototype._startTracing=function(t){var n=this._applyTracingHooks;this._options.Vue.mixin({beforeCreate:function(){t().getIntegration(b)||t().getIntegration(w)?n(this,t):m.error("Vue integration has tracing enabled, but Tracing integration is not configured")}})},t.prototype._attachErrorHandler=function(n){var o=this,e=this._options.Vue.config.errorHandler;this._options.Vue.config.errorHandler=function(r,i,a){var c={};if(i)try{c.componentName=o._getComponentName(i),o._options.attachProps&&(c.propsData=i.$options.propsData)}catch(t){m.warn("Unable to extract metadata from Vue component.")}a&&(c.lifecycleHook=a),n().getIntegration(t)&&setTimeout(function(){n().withScope(function(t){t.setContext("vue",c),n().captureException(r)})}),"function"==typeof e&&e.call(o._options.Vue,r,i,a),o._options.logErrors&&(o._options.Vue.util&&o._options.Vue.util.warn("Error in "+a+': "'+r.toString()+'"',i),console.error(r))}},t.prototype.setupOnce=function(t,n){this._options.Vue?(this._attachErrorHandler(n),this._options.tracing&&this._startTracing(n)):m.error("Vue integration is missing a Vue instance")},t.id="Vue",t}();function C(t){if(t&&t.getScope){var n=t.getScope();if(n)return n.getTransaction()}}for(var R in n.Vue=j,n.getActiveTransaction=C,t.Sentry=t.Sentry||{},t.Sentry.Integrations=t.Sentry.Integrations||{},n)Object.prototype.hasOwnProperty.call(n,R)&&(t.Sentry.Integrations[R]=n[R])}(window); | ||
//# sourceMappingURL=vue.min.js.map |
@@ -38,3 +38,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
this._getCurrentHub = getCurrentHub; | ||
var observer = new (utils_1.getGlobalObject()).ReportingObserver(this.handler.bind(this), { | ||
var observer = new (utils_1.getGlobalObject().ReportingObserver)(this.handler.bind(this), { | ||
buffered: true, | ||
@@ -41,0 +41,0 @@ types: this._options.types, |
@@ -1,2 +0,2 @@ | ||
import { EventProcessor, Hub, Integration } from '@sentry/types'; | ||
import { EventProcessor, Hub, Integration, Scope, Transaction } from '@sentry/types'; | ||
/** Global Vue object limited to the methods/attributes we require */ | ||
@@ -109,2 +109,7 @@ interface VueInstance { | ||
} | ||
interface HubType extends Hub { | ||
getScope?(): Scope | undefined; | ||
} | ||
/** Grabs active transaction off scope */ | ||
export declare function getActiveTransaction<T extends Transaction>(hub: HubType): T | undefined; | ||
export {}; |
@@ -7,2 +7,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
* without the need to import `Tracing` itself from the @sentry/apm package. | ||
* @deprecated as @sentry/tracing should be used over @sentry/apm. | ||
*/ | ||
@@ -12,2 +13,8 @@ var TRACING_GETTER = { | ||
}; | ||
/** | ||
* Used to extract BrowserTracing integration from @sentry/tracing | ||
*/ | ||
var BROWSER_TRACING_GETTER = { | ||
id: 'BrowserTracing', | ||
}; | ||
// Mappings from operation to corresponding lifecycle hook. | ||
@@ -67,2 +74,3 @@ var HOOKS = { | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -81,3 +89,13 @@ if (tracingIntegration) { | ||
} | ||
// Use functionality from @sentry/tracing | ||
} | ||
else { | ||
var activeTransaction = getActiveTransaction(getCurrentHub()); | ||
if (activeTransaction) { | ||
_this._rootSpan = activeTransaction.startChild({ | ||
description: 'Application Render', | ||
op: 'Vue', | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -182,2 +200,3 @@ } | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -187,7 +206,8 @@ if (tracingIntegration) { | ||
tracingIntegration.constructor.popActivity(_this._tracingActivity); | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
} | ||
} | ||
// We should always finish the span, only should pop activity if using @sentry/apm | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
}, this._options.tracingOptions.timeout); | ||
@@ -200,3 +220,4 @@ }; | ||
beforeCreate: function () { | ||
if (getCurrentHub().getIntegration(TRACING_GETTER)) { | ||
// tslint:disable-next-line: deprecation | ||
if (getCurrentHub().getIntegration(TRACING_GETTER) || getCurrentHub().getIntegration(BROWSER_TRACING_GETTER)) { | ||
// `this` points to currently rendered component | ||
@@ -271,2 +292,13 @@ applyTracingHooks(this, getCurrentHub); | ||
exports.Vue = Vue; | ||
/** Grabs active transaction off scope */ | ||
function getActiveTransaction(hub) { | ||
if (hub && hub.getScope) { | ||
var scope = hub.getScope(); | ||
if (scope) { | ||
return scope.getTransaction(); | ||
} | ||
} | ||
return undefined; | ||
} | ||
exports.getActiveTransaction = getActiveTransaction; | ||
//# sourceMappingURL=vue.js.map |
@@ -37,3 +37,3 @@ import * as tslib_1 from "tslib"; | ||
this._getCurrentHub = getCurrentHub; | ||
var observer = new (getGlobalObject()).ReportingObserver(this.handler.bind(this), { | ||
var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), { | ||
buffered: true, | ||
@@ -40,0 +40,0 @@ types: this._options.types, |
@@ -1,2 +0,2 @@ | ||
import { EventProcessor, Hub, Integration } from '@sentry/types'; | ||
import { EventProcessor, Hub, Integration, Scope, Transaction } from '@sentry/types'; | ||
/** Global Vue object limited to the methods/attributes we require */ | ||
@@ -109,2 +109,7 @@ interface VueInstance { | ||
} | ||
interface HubType extends Hub { | ||
getScope?(): Scope | undefined; | ||
} | ||
/** Grabs active transaction off scope */ | ||
export declare function getActiveTransaction<T extends Transaction>(hub: HubType): T | undefined; | ||
export {}; |
@@ -6,2 +6,3 @@ import * as tslib_1 from "tslib"; | ||
* without the need to import `Tracing` itself from the @sentry/apm package. | ||
* @deprecated as @sentry/tracing should be used over @sentry/apm. | ||
*/ | ||
@@ -11,2 +12,8 @@ var TRACING_GETTER = { | ||
}; | ||
/** | ||
* Used to extract BrowserTracing integration from @sentry/tracing | ||
*/ | ||
var BROWSER_TRACING_GETTER = { | ||
id: 'BrowserTracing', | ||
}; | ||
// Mappings from operation to corresponding lifecycle hook. | ||
@@ -66,2 +73,3 @@ var HOOKS = { | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -80,3 +88,13 @@ if (tracingIntegration) { | ||
} | ||
// Use functionality from @sentry/tracing | ||
} | ||
else { | ||
var activeTransaction = getActiveTransaction(getCurrentHub()); | ||
if (activeTransaction) { | ||
_this._rootSpan = activeTransaction.startChild({ | ||
description: 'Application Render', | ||
op: 'Vue', | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -181,2 +199,3 @@ } | ||
// We also need to ask for the `.constructor`, as `pushActivity` and `popActivity` are static, not instance methods. | ||
// tslint:disable-next-line: deprecation | ||
var tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER); | ||
@@ -186,7 +205,8 @@ if (tracingIntegration) { | ||
tracingIntegration.constructor.popActivity(_this._tracingActivity); | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
} | ||
} | ||
// We should always finish the span, only should pop activity if using @sentry/apm | ||
if (_this._rootSpan) { | ||
_this._rootSpan.finish(timestamp); | ||
} | ||
}, this._options.tracingOptions.timeout); | ||
@@ -199,3 +219,4 @@ }; | ||
beforeCreate: function () { | ||
if (getCurrentHub().getIntegration(TRACING_GETTER)) { | ||
// tslint:disable-next-line: deprecation | ||
if (getCurrentHub().getIntegration(TRACING_GETTER) || getCurrentHub().getIntegration(BROWSER_TRACING_GETTER)) { | ||
// `this` points to currently rendered component | ||
@@ -270,2 +291,12 @@ applyTracingHooks(this, getCurrentHub); | ||
export { Vue }; | ||
/** Grabs active transaction off scope */ | ||
export function getActiveTransaction(hub) { | ||
if (hub && hub.getScope) { | ||
var scope = hub.getScope(); | ||
if (scope) { | ||
return scope.getTransaction(); | ||
} | ||
} | ||
return undefined; | ||
} | ||
//# sourceMappingURL=vue.js.map |
{ | ||
"name": "@sentry/integrations", | ||
"version": "5.19.2", | ||
"version": "5.20.0", | ||
"description": "Pluggable integrations that can be used to enhance JS SDKs", | ||
@@ -19,4 +19,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/types": "5.19.2", | ||
"@sentry/utils": "5.19.2", | ||
"@sentry/types": "5.20.0", | ||
"@sentry/utils": "5.20.0", | ||
"tslib": "^1.9.3" | ||
@@ -36,4 +36,4 @@ }, | ||
"rollup-plugin-typescript2": "^0.21.0", | ||
"tslint": "^5.16.0", | ||
"typescript": "^3.4.5" | ||
"tslint": "5.16.0", | ||
"typescript": "3.4.5" | ||
}, | ||
@@ -40,0 +40,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1577977
8949
+ Added@sentry/types@5.20.0(transitive)
+ Added@sentry/utils@5.20.0(transitive)
- Removed@sentry/types@5.19.2(transitive)
- Removed@sentry/utils@5.19.2(transitive)
Updated@sentry/types@5.20.0
Updated@sentry/utils@5.20.0