|
1 |
| -/*! Raven.js 2.2.1 (639131b) | github.com/getsentry/raven-js */ |
| 1 | +/*! Raven.js 2.3.0 (b09d766) | github.com/getsentry/raven-js */ |
2 | 2 |
|
3 | 3 | /*
|
4 | 4 | * Includes TraceKit
|
@@ -100,7 +100,7 @@ Raven.prototype = {
|
100 | 100 | // webpack (using a build step causes webpack #1617). Grunt verifies that
|
101 | 101 | // this value matches package.json during build.
|
102 | 102 | // See: https://github.com/getsentry/raven-js/issues/465
|
103 |
| - VERSION: '2.2.1', |
| 103 | + VERSION: '2.3.0', |
104 | 104 |
|
105 | 105 | debug: false,
|
106 | 106 |
|
@@ -880,7 +880,7 @@ Raven.prototype = {
|
880 | 880 | message += '';
|
881 | 881 | message = truncate(message, this._globalOptions.maxMessageLength);
|
882 | 882 |
|
883 |
| - fullMessage = type + ': ' + message; |
| 883 | + fullMessage = (type ? type + ': ' : '') + message; |
884 | 884 | fullMessage = truncate(fullMessage, this._globalOptions.maxMessageLength);
|
885 | 885 |
|
886 | 886 | if (frames && frames.length) {
|
@@ -1357,6 +1357,9 @@ var TraceKit = {
|
1357 | 1357 | var _slice = [].slice;
|
1358 | 1358 | var UNKNOWN_FUNCTION = '?';
|
1359 | 1359 |
|
| 1360 | +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types |
| 1361 | +var ERROR_TYPES_RE = /^(?:Uncaught )?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error)\: ?(.*)$/; |
| 1362 | + |
1360 | 1363 | function getLocationHref() {
|
1361 | 1364 | if (typeof document === 'undefined')
|
1362 | 1365 | return '';
|
@@ -1495,8 +1498,21 @@ TraceKit.report = (function reportModuleWrapper() {
|
1495 | 1498 | };
|
1496 | 1499 | location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);
|
1497 | 1500 | location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);
|
| 1501 | + |
| 1502 | + var name = undefined; |
| 1503 | + var msg = message; // must be new var or will modify original `arguments` |
| 1504 | + var groups; |
| 1505 | + if (isString(message)) { |
| 1506 | + var groups = message.match(ERROR_TYPES_RE); |
| 1507 | + if (groups) { |
| 1508 | + name = groups[1]; |
| 1509 | + msg = groups[2]; |
| 1510 | + } |
| 1511 | + } |
| 1512 | + |
1498 | 1513 | stack = {
|
1499 |
| - 'message': message, |
| 1514 | + 'name': name, |
| 1515 | + 'message': msg, |
1500 | 1516 | 'url': getLocationHref(),
|
1501 | 1517 | 'stack': [location]
|
1502 | 1518 | };
|
@@ -1950,7 +1966,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
|
1950 | 1966 | if (isUndefined(ex.stack) || !ex.stack) return;
|
1951 | 1967 |
|
1952 | 1968 | var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|<anonymous>).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
|
1953 |
| - gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[).*?)(?::(\d+))?(?::(\d+))?\s*$/i, |
| 1969 | + gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i, |
1954 | 1970 | winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
|
1955 | 1971 | lines = ex.stack.split('\n'),
|
1956 | 1972 | stack = [],
|
|
0 commit comments