Skip to content

Commit 3a5307c

Browse files
committed
1.1.12
1 parent b41f706 commit 3a5307c

File tree

6 files changed

+47
-43
lines changed

6 files changed

+47
-43
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "1.1.11",
3+
"version": "1.1.12",
44
"dependencies": {},
55
"main": "dist/raven.js"
66
}

dist/raven.js

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 1.1.11 (11645a0) | github.com/getsentry/raven-js */
1+
/*! Raven.js 1.1.12 (b41f706) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -1107,31 +1107,16 @@ var _Raven = window.Raven,
11071107
collectWindowErrors: true,
11081108
tags: {},
11091109
extra: {}
1110-
};
1110+
},
1111+
authQueryString;
11111112

11121113
/*
11131114
* The core Raven singleton
11141115
*
11151116
* @this {Raven}
11161117
*/
11171118
var Raven = {
1118-
VERSION: '1.1.11',
1119-
1120-
// Expose TraceKit to the Raven namespace
1121-
TraceKit: TraceKit,
1122-
1123-
/*
1124-
* Allow Raven to be configured as soon as it is loaded
1125-
* It uses a global RavenConfig = {dsn: '...', config: {}}
1126-
*
1127-
* @return undefined
1128-
*/
1129-
afterLoad: function() {
1130-
var globalConfig = window.RavenConfig;
1131-
if (globalConfig) {
1132-
this.config(globalConfig.dsn, globalConfig.config).install();
1133-
}
1134-
},
1119+
VERSION: '1.1.12',
11351120

11361121
/*
11371122
* Allow multiple versions of Raven to be installed.
@@ -1198,6 +1183,8 @@ var Raven = {
11981183

11991184
TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
12001185

1186+
setAuthQueryString();
1187+
12011188
// return for chaining
12021189
return Raven;
12031190
},
@@ -1294,6 +1281,7 @@ var Raven = {
12941281
// Signal that this function has been wrapped already
12951282
// for both debugging and to prevent it to being wrapped twice
12961283
wrapped.__raven__ = true;
1284+
wrapped.__inner__ = func;
12971285

12981286
return wrapped;
12991287
},
@@ -1494,23 +1482,15 @@ function each(obj, callback) {
14941482
}
14951483
}
14961484

1497-
var cachedAuth;
14981485

1499-
function getAuthQueryString() {
1500-
if (cachedAuth) return cachedAuth;
1501-
1502-
var qs = [
1503-
'sentry_version=4',
1504-
'sentry_client=raven-js/' + Raven.VERSION
1505-
];
1506-
if (globalKey) {
1507-
qs.push('sentry_key=' + globalKey);
1508-
}
1509-
1510-
cachedAuth = '?' + qs.join('&');
1511-
return cachedAuth;
1486+
function setAuthQueryString() {
1487+
authQueryString =
1488+
'?sentry_version=4' +
1489+
'&sentry_client=raven-js/' + Raven.VERSION +
1490+
'&sentry_key=' + globalKey;
15121491
}
15131492

1493+
15141494
function handleStackInfo(stackInfo, options) {
15151495
var frames = [];
15161496

@@ -1633,6 +1613,9 @@ function processException(type, message, fileurl, lineno, frames, options) {
16331613
};
16341614
}
16351615

1616+
// Truncate the message to a max of characters
1617+
message = truncate(message, 100);
1618+
16361619
if (globalOptions.ignoreUrls && globalOptions.ignoreUrls.test(fileurl)) return;
16371620
if (globalOptions.whitelistUrls && !globalOptions.whitelistUrls.test(fileurl)) return;
16381621

@@ -1664,6 +1647,10 @@ function objectMerge(obj1, obj2) {
16641647
return obj1;
16651648
}
16661649

1650+
function truncate(str, max) {
1651+
return str.length <= max ? str : str.substr(0, max) + '…';
1652+
}
1653+
16671654
function getHttpData() {
16681655
var http = {
16691656
url: document.location.href,
@@ -1716,15 +1703,15 @@ function send(data) {
17161703
// Send along an event_id if not explicitly passed.
17171704
// This event_id can be used to reference the error within Sentry itself.
17181705
// Set lastEventId after we know the error should actually be sent
1719-
lastEventId = data.event_id || (data.event_id = generateUUID4());
1706+
lastEventId = data.event_id || (data.event_id = uuid4());
17201707

17211708
makeRequest(data);
17221709
}
17231710

17241711

17251712
function makeRequest(data) {
17261713
var img = new Image(),
1727-
src = globalServer + getAuthQueryString() + '&sentry_data=' + encodeURIComponent(JSON.stringify(data));
1714+
src = globalServer + authQueryString + '&sentry_data=' + encodeURIComponent(JSON.stringify(data));
17281715

17291716
img.onload = function success() {
17301717
triggerEvent('success', {
@@ -1775,15 +1762,22 @@ function joinRegExp(patterns) {
17751762
}
17761763

17771764
// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
1778-
function generateUUID4() {
1765+
function uuid4() {
17791766
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
17801767
var r = Math.random()*16|0,
17811768
v = c == 'x' ? r : (r&0x3|0x8);
17821769
return v.toString(16);
17831770
});
17841771
}
17851772

1786-
Raven.afterLoad();
1773+
function afterLoad() {
1774+
// Attempt to initialize Raven on load
1775+
var RavenConfig = window.RavenConfig;
1776+
if (RavenConfig) {
1777+
Raven.config(RavenConfig.dsn, RavenConfig.config).install();
1778+
}
1779+
}
1780+
afterLoad();
17871781

17881782
// Expose Raven to the world
17891783
window.Raven = Raven;
@@ -1793,4 +1787,4 @@ if (typeof define === 'function' && define.amd) {
17931787
define('raven', [], function() { return Raven; });
17941788
}
17951789

1796-
})(window);
1790+
})(this);

dist/raven.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/raven.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/changelog/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Changelog
22
=========
33

4+
1.1.12
5+
~~~~~~
6+
* Fix a bug using the ``console`` plugin with older IE. See: https://github.com/getsentry/raven-js/pull/192
7+
* Added initial ``ember.js`` plugin for early testing and feedback.
8+
* Added initial ``angular.js`` plugin for early testing and feedback.
9+
* Fixed an issue with the ``require.js`` plugin basically not working at all. See: https://github.com/getsentry/raven-js/commit/c2a2e2672a2a61a5a07e88f24a9c885f6dba57ae
10+
* Got rid of ``Raven.afterLoad`` and made it internal only.
11+
* ``Raven.TraceKit`` is now internal only.
12+
* Truncate message length to a max of 100 characters becasue angular.js sucks and generates stupidly large error messages.
13+
414
1.1.11
515
~~~~~~
616
* Capture column number from FireFox

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven",
3-
"version": "1.1.11",
3+
"version": "1.1.12",
44
"scripts": {
55
"test": "./node_modules/.bin/grunt test"
66
},

0 commit comments

Comments
 (0)