diff options
author | Sam Potts <sam@potts.es> | 2018-04-27 00:47:51 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-04-27 00:47:51 +1000 |
commit | a812650fea4b61878a50b0a1cc09c5043fbe815e (patch) | |
tree | 88996b3bd1bf6d8eef9ee4f5b977eb260a06862b /demo/dist/demo.js | |
parent | fec7a77d6ffa0ac450d5513661dc292f430ad7ba (diff) | |
download | plyr-a812650fea4b61878a50b0a1cc09c5043fbe815e.tar.lz plyr-a812650fea4b61878a50b0a1cc09c5043fbe815e.tar.xz plyr-a812650fea4b61878a50b0a1cc09c5043fbe815e.zip |
v3.2.4
Diffstat (limited to 'demo/dist/demo.js')
-rw-r--r-- | demo/dist/demo.js | 72 |
1 files changed, 53 insertions, 19 deletions
diff --git a/demo/dist/demo.js b/demo/dist/demo.js index 65b54f51..86587e10 100644 --- a/demo/dist/demo.js +++ b/demo/dist/demo.js @@ -245,7 +245,13 @@ function objectFrozen(obj) { } function truncate(str, max) { - return !max || str.length <= max ? str : str.substr(0, max) + '\u2026'; + if (typeof max !== 'number') { + throw new Error('2nd argument to `truncate` function should be a number'); + } + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : str.substr(0, max) + '\u2026'; } /** @@ -544,10 +550,9 @@ function jsonSize(value) { } function serializeValue(value) { - var maxLength = 40; - if (typeof value === 'string') { - return value.length <= maxLength ? value : value.substr(0, maxLength - 1) + '\u2026'; + var maxLength = 40; + return truncate(value, maxLength); } else if ( typeof value === 'number' || typeof value === 'boolean' || @@ -1777,7 +1782,7 @@ Raven.prototype = { // webpack (using a build step causes webpack #1617). Grunt verifies that // this value matches package.json during build. // See: https://github.com/getsentry/raven-js/issues/465 - VERSION: '3.24.0', + VERSION: '3.24.2', debug: false, @@ -2066,7 +2071,11 @@ Raven.prototype = { */ _promiseRejectionHandler: function(event) { this._logDebug('debug', 'Raven caught unhandled promise rejection:', event); - this.captureException(event.reason); + this.captureException(event.reason, { + extra: { + unhandledPromiseRejection: true + } + }); }, /** @@ -2207,6 +2216,14 @@ Raven.prototype = { // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1] var initialCall = isArray$1(stack.stack) && stack.stack[1]; + + // if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call + // to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd + // initialCall => captureException(string) => captureMessage(string) + if (initialCall && initialCall.func === 'Raven.captureException') { + initialCall = stack.stack[2]; + } + var fileurl = (initialCall && initialCall.url) || ''; if ( @@ -3004,17 +3021,30 @@ Raven.prototype = { status_code: null }; - return origFetch.apply(this, args).then(function(response) { - fetchData.status_code = response.status; + return origFetch + .apply(this, args) + .then(function(response) { + fetchData.status_code = response.status; - self.captureBreadcrumb({ - type: 'http', - category: 'fetch', - data: fetchData - }); + self.captureBreadcrumb({ + type: 'http', + category: 'fetch', + data: fetchData + }); - return response; - }); + return response; + }) + ['catch'](function(err) { + // if there is an error performing the request + self.captureBreadcrumb({ + type: 'http', + category: 'fetch', + data: fetchData, + level: 'error' + }); + + throw err; + }); }; }, wrappedBuiltIns @@ -3027,7 +3057,7 @@ Raven.prototype = { if (_document.addEventListener) { _document.addEventListener('click', self._breadcrumbEventHandler('click'), false); _document.addEventListener('keypress', self._keypressEventHandler(), false); - } else { + } else if (_document.attachEvent) { // IE8 Compatibility _document.attachEvent('onclick', self._breadcrumbEventHandler('click')); _document.attachEvent('onkeypress', self._keypressEventHandler()); @@ -3750,7 +3780,11 @@ Raven.prototype = { }, _logDebug: function(level) { - if (this._originalConsoleMethods[level] && this.debug) { + // We allow `Raven.debug` and `Raven.config(DSN, { debug: true })` to not make backward incompatible API change + if ( + this._originalConsoleMethods[level] && + (this.debug || this._globalOptions.debug) + ) { // In IE<10 console methods do not have their own 'apply' method Function.prototype.apply.call( this._originalConsoleMethods[level], @@ -3823,11 +3857,11 @@ var singleton = Raven$1; * const someAppReporter = new Raven.Client(); * const someOtherAppReporter = new Raven.Client(); * - * someAppReporter('__DSN__', { + * someAppReporter.config('__DSN__', { * ...config goes here * }); * - * someOtherAppReporter('__OTHER_DSN__', { + * someOtherAppReporter.config('__OTHER_DSN__', { * ...config goes here * }); * |