Skip to content

Commit 5d9a3aa

Browse files
committedMay 5, 2017
3.15.0
1 parent d49a1b8 commit 5d9a3aa

21 files changed

+69
-34
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.15.0
4+
* NEW: Added new `instrument` config option. See: https://github.com/getsentry/raven-js/pull/938
5+
* NEW: Support CJS use of AngularJS module. See documentation: https://docs.sentry.io/clients/javascript/integrations/angularjs/
6+
37
## 3.14.2
48
* BUGFIX: Fix bug in breadcrumb URL truncation when `fetch` is used with a `Request` argument. See: https://github.com/getsentry/raven-js/issues/924
59

‎bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.14.2",
3+
"version": "3.15.0",
44
"dependencies": {},
55
"main": "dist/raven.js",
66
"ignore": [

‎dist/plugins/angular.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -20,6 +20,7 @@
2020

2121
// See https://github.com/angular/angular.js/blob/v1.4.7/src/minErr.js
2222
var angularPattern = /^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/;
23+
var moduleName = 'ngRaven';
2324

2425

2526
function angularPlugin(Raven, angular) {
@@ -47,7 +48,7 @@ function angularPlugin(Raven, angular) {
4748
};
4849
}
4950

50-
angular.module('ngRaven', [])
51+
angular.module(moduleName, [])
5152
.provider('Raven', RavenProvider)
5253
.config(['$provide', ExceptionHandlerProvider]);
5354

@@ -77,6 +78,8 @@ angularPlugin._normalizeData = function (data) {
7778
}
7879
};
7980

81+
angularPlugin.moduleName = moduleName;
82+
8083
module.exports = angularPlugin;
8184

8285
},{}]},{},[1])(1)

‎dist/plugins/angular.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/plugins/angular.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/plugins/console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

‎dist/plugins/console.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/plugins/ember.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

‎dist/plugins/ember.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/plugins/require.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

‎dist/plugins/require.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/plugins/vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

‎dist/plugins/vue.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/raven.js

+34-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.14.2 (5cf57e1) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.15.0 (d49a1b8) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -120,6 +120,7 @@ function Raven() {
120120
maxUrlLength: 250,
121121
stackTraceLimit: 50,
122122
autoBreadcrumbs: true,
123+
instrument: true,
123124
sampleRate: 1
124125
};
125126
this._ignoreOnError = 0;
@@ -155,7 +156,7 @@ Raven.prototype = {
155156
// webpack (using a build step causes webpack #1617). Grunt verifies that
156157
// this value matches package.json during build.
157158
// See: https://github.com/getsentry/raven-js/issues/465
158-
VERSION: '3.14.2',
159+
VERSION: '3.15.0',
159160

160161
debug: false,
161162

@@ -220,6 +221,18 @@ Raven.prototype = {
220221
}
221222
globalOptions.autoBreadcrumbs = autoBreadcrumbs;
222223

224+
var instrumentDefaults = {
225+
tryCatch: true
226+
};
227+
228+
var instrument = globalOptions.instrument;
229+
if ({}.toString.call(instrument) === '[object Object]') {
230+
instrument = objectMerge(instrumentDefaults, instrument);
231+
} else if (instrument !== false) {
232+
instrument = instrumentDefaults;
233+
}
234+
globalOptions.instrument = instrument;
235+
223236
TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
224237

225238
// return for chaining
@@ -240,7 +253,10 @@ Raven.prototype = {
240253
TraceKit.report.subscribe(function () {
241254
self._handleOnErrorStackInfo.apply(self, arguments);
242255
});
243-
self._instrumentTryCatch();
256+
if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
257+
self._instrumentTryCatch();
258+
}
259+
244260
if (self._globalOptions.autoBreadcrumbs)
245261
self._instrumentBreadcrumbs();
246262

@@ -918,7 +934,8 @@ Raven.prototype = {
918934
},
919935

920936
/**
921-
* Install any queued plugins
937+
* Wrap timer functions and event targets to catch errors and provide
938+
* better metadata.
922939
*/
923940
_instrumentTryCatch: function() {
924941
var self = this;
@@ -1116,19 +1133,30 @@ Raven.prototype = {
11161133
// Make a copy of the arguments to prevent deoptimization
11171134
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
11181135
var args = new Array(arguments.length);
1119-
for(var i = 0; i < args.length; ++i) {
1136+
for (var i = 0; i < args.length; ++i) {
11201137
args[i] = arguments[i];
11211138
}
11221139

1140+
var fetchInput = args[0];
11231141
var method = 'GET';
1142+
var url;
1143+
1144+
if (typeof fetchInput === 'string') {
1145+
url = fetchInput;
1146+
} else {
1147+
url = fetchInput.url;
1148+
if (fetchInput.method) {
1149+
method = fetchInput.method;
1150+
}
1151+
}
11241152

11251153
if (args[1] && args[1].method) {
11261154
method = args[1].method;
11271155
}
11281156

11291157
var fetchData = {
11301158
method: method,
1131-
url: args[0],
1159+
url: url,
11321160
status_code: null
11331161
};
11341162

‎dist/raven.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/raven.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)