Skip to content

Commit 82b9c07

Browse files
committed
1.1.19
1 parent b51bc89 commit 82b9c07

File tree

7 files changed

+66
-12
lines changed

7 files changed

+66
-12
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.18",
3+
"version": "1.1.19",
44
"dependencies": {},
55
"main": "dist/raven.js",
66
"ignore": {}

dist/raven.js

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 1.1.18 (8ad15bc) | github.com/getsentry/raven-js */
1+
/*! Raven.js 1.1.19 (b51bc89) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -1093,7 +1093,7 @@ var _Raven = window.Raven,
10931093
* @this {Raven}
10941094
*/
10951095
var Raven = {
1096-
VERSION: '1.1.18',
1096+
VERSION: '1.1.19',
10971097

10981098
debug: true,
10991099

@@ -1385,6 +1385,32 @@ var Raven = {
13851385
return Raven;
13861386
},
13871387

1388+
/*
1389+
* Set the dataCallback option
1390+
*
1391+
* @param {function} callback The callback to run which allows the
1392+
* data blob to be mutated before sending
1393+
* @return {Raven}
1394+
*/
1395+
setDataCallback: function(callback) {
1396+
globalOptions.dataCallback = callback;
1397+
1398+
return Raven;
1399+
},
1400+
1401+
/*
1402+
* Set the shouldSendCallback option
1403+
*
1404+
* @param {function} callback The callback to run which allows
1405+
* introspecting the blob before sending
1406+
* @return {Raven}
1407+
*/
1408+
setShouldSendCallback: function(callback) {
1409+
globalOptions.shouldSendCallback = callback;
1410+
1411+
return Raven;
1412+
},
1413+
13881414
/*
13891415
* Get the latest raw exception that was captured by Raven.
13901416
*
@@ -1475,15 +1501,15 @@ function parseDSN(str) {
14751501
}
14761502

14771503
function isUndefined(what) {
1478-
return typeof what === 'undefined';
1504+
return what === void 0;
14791505
}
14801506

14811507
function isFunction(what) {
14821508
return typeof what === 'function';
14831509
}
14841510

14851511
function isString(what) {
1486-
return typeof what === 'string';
1512+
return objectPrototype.toString.call(what) === '[object String]';
14871513
}
14881514

14891515
function isObject(what) {
@@ -1758,7 +1784,12 @@ function send(data) {
17581784
if (globalOptions.release) data.release = globalOptions.release;
17591785

17601786
if (isFunction(globalOptions.dataCallback)) {
1761-
data = globalOptions.dataCallback(data);
1787+
data = globalOptions.dataCallback(data) || data;
1788+
}
1789+
1790+
// Why??????????
1791+
if (!data || isEmptyObject(data)) {
1792+
return;
17621793
}
17631794

17641795
// Check if the request should be filtered or not
@@ -1776,7 +1807,7 @@ function send(data) {
17761807

17771808

17781809
function makeRequest(data) {
1779-
var img = new Image(),
1810+
var img = newImage(),
17801811
src = globalServer + authQueryString + '&sentry_data=' + encodeURIComponent(JSON.stringify(data));
17811812

17821813
img.crossOrigin = 'anonymous';
@@ -1795,6 +1826,13 @@ function makeRequest(data) {
17951826
img.src = src;
17961827
}
17971828

1829+
// Note: this is shitty, but I can't figure out how to get
1830+
// sinon to stub document.createElement without breaking everything
1831+
// so this wrapper is just so I can stub it for tests.
1832+
function newImage() {
1833+
return document.createElement('img');
1834+
}
1835+
17981836
function isSetup() {
17991837
if (!hasJSON) return false; // needs JSON support
18001838
if (!globalServer) {
@@ -1868,4 +1906,4 @@ if (typeof define === 'function' && define.amd) {
18681906
window.Raven = Raven;
18691907
}
18701908

1871-
})(window);
1909+
})(typeof window !== 'undefined' ? window : 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.19
5+
~~~~~~
6+
* Use more compliant way of creating an Image in the dom. See: https://github.com/getsentry/raven-js/pull/334
7+
* `String` objects weren't getting identified as a string. See: https://github.com/getsentry/raven-js/pull/336
8+
* Expose getter/setter for dataCallback and shouldSendCallback
9+
* Better handle if/when the dataCallback returns garbage
10+
* Fix support for nodeunit. See: https://github.com/getsentry/raven-js/pull/338
11+
* Fix `console.warn` sending as a `warning` level to server. See: https://github.com/getsentry/raven-js/issues/342
12+
* Improve the capture of unhandled errors from promises in Ember plugin. See: https://github.com/getsentry/raven-js/pull/330
13+
414
1.1.18
515
~~~~~~
616
* Fixed a trailing comma which would make IE8 cry. This affects the uncompressed builds only. Compressed builds were unaffected. See: https://github.com/getsentry/raven-js/pull/333

docs/config/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ A function that allows mutation of the data payload right before being sent to S
125125
}
126126
}
127127
128+
Can also be set at runtime with `Raven.setDataCallback(function(data) { ... })`.
129+
128130
shouldSendCallback
129131
------------------
130132

@@ -138,6 +140,8 @@ A callback function that allows you to apply your own filters to determine if th
138140
}
139141
}
140142
143+
Can also be set at runtime with `Raven.setShouldSendCallback(function(data) { ... })`.
144+
141145
maxMessageLength
142146
------------------
143147

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "raven-js",
3-
"version": "1.1.18",
3+
"version": "1.1.19",
4+
"license": "BSD-2-Clause",
5+
"homepage": "https://getsentry.com",
46
"scripts": {
57
"pretest": "npm install",
68
"test": "grunt test"

0 commit comments

Comments
 (0)