Skip to content

Commit 9f38a30

Browse files
committed
Merge branch 'master' of https://github.com/getsentry/raven-js
# Conflicts: # typescript/raven.d.ts
2 parents 7fdef1f + 7339bd8 commit 9f38a30

27 files changed

+78
-50
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ language: node_js
33
node_js:
44
- "4"
55
script:
6-
- node_modules/.bin/grunt test
6+
- npm test

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.9.2
4+
* BUGFIX: Use json-stringify-safe in React Native plugin to avoid circular refs. See: https://github.com/getsentry/raven-js/pull/829
5+
* BUGFIX: Avoid document.location access in React Native plugin. See: https://github.com/getsentry/raven-js/issues/800
6+
37
## 3.9.1
48
* BUGFIX: Fix TypeError triggered by some event listeners. See: https://github.com/getsentry/raven-js/issues/793
59
* BUGFIX: Fix bad `window` access in web worker environments. See: https://github.com/getsentry/raven-js/pull/792

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

dist/plugins/angular.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*

dist/plugins/angular.min.js

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

dist/plugins/console.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*

dist/plugins/console.min.js

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

dist/plugins/ember.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*

dist/plugins/ember.min.js

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

dist/plugins/require.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*

dist/plugins/require.min.js

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

dist/plugins/vue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*

dist/plugins/vue.min.js

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

dist/raven.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*! Raven.js 3.9.1 (7bbae7d) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.9.2 (5286373) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
55
* https://github.com/getsentry/TraceKit
66
*
7-
* Copyright 2016 Matt Robenolt and other contributors
7+
* Copyright 2017 Matt Robenolt and other contributors
88
* Released under the BSD license
99
* https://github.com/getsentry/raven-js/blob/master/LICENSE
1010
*
@@ -172,7 +172,7 @@ Raven.prototype = {
172172
// webpack (using a build step causes webpack #1617). Grunt verifies that
173173
// this value matches package.json during build.
174174
// See: https://github.com/getsentry/raven-js/issues/465
175-
VERSION: '3.9.1',
175+
VERSION: '3.9.2',
176176

177177
debug: false,
178178

@@ -1960,7 +1960,7 @@ var UNKNOWN_FUNCTION = '?';
19601960
var ERROR_TYPES_RE = /^(?:Uncaught (?:exception: )?)?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error): ?(.*)$/;
19611961

19621962
function getLocationHref() {
1963-
if (typeof document === 'undefined')
1963+
if (typeof document === 'undefined' || typeof document.location === 'undefined')
19641964
return '';
19651965

19661966
return document.location.href;

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.js.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.

dist/sri.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"@dist/raven.js": {
33
"hashes": {
4-
"sha256": "ihdEI9/hV9q/+yUm+WxgLgncmbFnuK9tr/lRnRgr60k=",
5-
"sha512": "4WMClk7qzYHXT5/xR3X9RkpNs8dg/FIfbJ7RTythr9rXMRAVIDimD2X6NLEUdID+c7sJ3b6oOvsmf6oB0ORhwg=="
4+
"sha256": "LJk9mpSaLNe5OiPeVilljWT/19pH0m8BVTv5beKC3iM=",
5+
"sha512": "hjC0XVht94rSQP/cvndw3Z0NB5UsDgojmYAZ5Dk5j44OQGgW4jfVjFjvecNrhPXjec4dtFaFdP9PyCqW/CIX6w=="
66
},
77
"type": null,
8-
"integrity": "sha256-ihdEI9/hV9q/+yUm+WxgLgncmbFnuK9tr/lRnRgr60k= sha512-4WMClk7qzYHXT5/xR3X9RkpNs8dg/FIfbJ7RTythr9rXMRAVIDimD2X6NLEUdID+c7sJ3b6oOvsmf6oB0ORhwg==",
8+
"integrity": "sha256-LJk9mpSaLNe5OiPeVilljWT/19pH0m8BVTv5beKC3iM= sha512-hjC0XVht94rSQP/cvndw3Z0NB5UsDgojmYAZ5Dk5j44OQGgW4jfVjFjvecNrhPXjec4dtFaFdP9PyCqW/CIX6w==",
99
"path": "dist/raven.js"
1010
},
1111
"@dist/raven.min.js": {
1212
"hashes": {
13-
"sha256": "Iwsp4zEtQhPhOFbMNyTevyNpy7XTm8qUPteSJyopHDM=",
14-
"sha512": "lL3X3M9f+DKT/mcKDJWixbXdXhVlYGWxy5DuPYyV6LrD8KNWQJ6ahpvTK3IyosXEAj3x+PWQ1DnFbKyGbIGdBw=="
13+
"sha256": "RQ2cvD7tXgOG7hgiNUknpPGVg3Eu7UI5sO4lmb2Mloo=",
14+
"sha512": "FPpKmmpnrw6sYdChKdgzuUeAOHIVtug53GBhmanL57JKgVvU+1kngVPZuTcZU8cwptB0P0cE/ImnmIEgdF1avg=="
1515
},
1616
"type": null,
17-
"integrity": "sha256-Iwsp4zEtQhPhOFbMNyTevyNpy7XTm8qUPteSJyopHDM= sha512-lL3X3M9f+DKT/mcKDJWixbXdXhVlYGWxy5DuPYyV6LrD8KNWQJ6ahpvTK3IyosXEAj3x+PWQ1DnFbKyGbIGdBw==",
17+
"integrity": "sha256-RQ2cvD7tXgOG7hgiNUknpPGVg3Eu7UI5sO4lmb2Mloo= sha512-FPpKmmpnrw6sYdChKdgzuUeAOHIVtug53GBhmanL57JKgVvU+1kngVPZuTcZU8cwptB0P0cE/ImnmIEgdF1avg==",
1818
"path": "dist/raven.min.js"
1919
}
2020
}

docs/integrations/angular2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Then, in your main module file (where ``@NgModule`` is called, e.g. app.module.t
6767
.config('___PUBLIC_DSN___')
6868
.install();
6969
70-
class RavenErrorHandler implements ErrorHandler {
70+
export class RavenErrorHandler implements ErrorHandler {
7171
handleError(err:any) : void {
7272
Raven.captureException(err.originalError);
7373
}
@@ -99,7 +99,7 @@ Angular CLI now uses Webpack to build instead of SystemJS. All you need to do is
9999
.config('___PUBLIC_DSN___')
100100
.install();
101101
102-
class RavenErrorHandler implements ErrorHandler {
102+
export class RavenErrorHandler implements ErrorHandler {
103103
handleError(err:any) : void {
104104
Raven.captureException(err.originalError);
105105
}

docs/sentry-doc-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
}
6767
},
6868
"vars": {
69-
"RAVEN_VERSION": "3.9.1"
69+
"RAVEN_VERSION": "3.9.2"
7070
}
7171
}

docs/sourcemaps.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ that maps the minified code back to the original source:
2727

2828
node_modules/uglify-js/bin/uglifyjs {input} \
2929
--source-map-root={relroot}/ \
30-
--source-map-url={name}.map.js \
31-
--source-map={relpath}/{name}.map.js \
30+
--source-map-url={name}.js.map \
31+
--source-map={relpath}/{name}.js.map \
3232
--source-map-include-sources \
3333
-o {output}
3434

@@ -52,7 +52,7 @@ Webpack can be configured to output source maps by editing webpack.config.js.
5252
output: {
5353
path: path.join(__dirname, 'dist'),
5454
filename: "[name].js",
55-
sourceMapFilename: "[name].map.js",
55+
sourceMapFilename: "[name].js.map",
5656
}
5757
};
5858

@@ -106,15 +106,15 @@ on the last line, the following directive is found:
106106

107107
.. code-block:: javascript
108108
109-
//# sourceMappingURL=app.map.js
109+
//# sourceMappingURL=app.js.map
110110
111-
Sentry will attempt to fetch ``app.map.js`` from http://example.org/js/app.map.js.
111+
Sentry will attempt to fetch ``app.js.map`` from http://example.org/js/app.js.map.
112112

113113
Alternatively, during source map generation you can specify a fully qualified URL where your source maps are located:
114114

115115
.. code-block:: javascript
116116
117-
//# sourceMappingURL=http://example.org/js/app.map.js
117+
//# sourceMappingURL=http://example.org/js/app.js.map
118118
119119
While making source maps available to Sentry from your servers is the easiest integration, it is not always advisable:
120120

@@ -172,7 +172,7 @@ if a browser (or filesystem) had to resolve its path. So for example, if your so
172172
reference is just a relative path, it's **relative to the location of the referencing file**.
173173

174174
So for example, if you have ``http://example.com/app.min.js``, and the file contains the
175-
reference to ``app.map.js``, the name of the uploaded file should be ``http://example.com/app.map.js``.
175+
reference to ``app.js.map``, the name of the uploaded file should be ``http://example.com/app.js.map``.
176176

177177
.. code-block:: bash
178178

package.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": "3.9.1",
3+
"version": "3.9.2",
44
"license": "BSD-2-Clause",
55
"homepage": "https://github.com/getsentry/raven-js",
66
"scripts": {

plugins/react-native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// /var/containers/Bundle/Application/{DEVICE_ID}/HelloWorld.app/main.jsbundle
2424

2525
var PATH_STRIP_RE = /^.*\/[^\.]+(\.app|CodePush)/;
26-
26+
var stringify = require('json-stringify-safe');
2727
var FATAL_ERROR_KEY = '--rn-fatal--';
2828
var ASYNC_STORAGE_KEY = '--raven-js-global-error-payload--';
2929

@@ -137,7 +137,7 @@ function reactNativePlugin(Raven, options) {
137137
*/
138138
reactNativePlugin._persistPayload = function(payload) {
139139
var AsyncStorage = require('react-native').AsyncStorage;
140-
return AsyncStorage.setItem(ASYNC_STORAGE_KEY, JSON.stringify(payload))
140+
return AsyncStorage.setItem(ASYNC_STORAGE_KEY, stringify(payload))
141141
['catch'](function() { return null; });
142142
}
143143

@@ -198,7 +198,7 @@ reactNativePlugin._transport = function (options) {
198198
// Just set a phony Origin value; only matters if Sentry Project is configured
199199
// to whitelist specific origins.
200200
request.setRequestHeader('Origin', 'react-native://');
201-
request.send(JSON.stringify(options.data));
201+
request.send(stringify(options.data));
202202
};
203203

204204
/**

src/raven.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Raven.prototype = {
7878
// webpack (using a build step causes webpack #1617). Grunt verifies that
7979
// this value matches package.json during build.
8080
// See: https://github.com/getsentry/raven-js/issues/465
81-
VERSION: '3.9.1',
81+
VERSION: '3.9.2',
8282

8383
debug: false,
8484

test/raven.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ describe('globals', function() {
10041004
extra: {'session:duration': 100},
10051005
});
10061006
assert.deepEqual(opts.auth, {
1007-
sentry_client: 'raven-js/3.9.1',
1007+
sentry_client: 'raven-js/3.9.2',
10081008
sentry_key: 'abc',
10091009
sentry_version: '7'
10101010
});
@@ -1051,7 +1051,7 @@ describe('globals', function() {
10511051
extra: {'session:duration': 100},
10521052
});
10531053
assert.deepEqual(opts.auth, {
1054-
sentry_client: 'raven-js/3.9.1',
1054+
sentry_client: 'raven-js/3.9.2',
10551055
sentry_key: 'abc',
10561056
sentry_secret: 'def',
10571057
sentry_version: '7'

test/vendor/fixtures/captured-errors.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,15 @@ CapturedExceptions.PHANTOMJS_1_19 = {
340340
" at http://path/to/file.js:4287"
341341
};
342342

343+
CapturedExceptions.FIREFOX_50_RESOURCE_URL= {
344+
stack: 'render@resource://path/data/content/bundle.js:5529:16\n' +
345+
'dispatchEvent@resource://path/data/content/vendor.bundle.js:18:23028\n' +
346+
'wrapped@resource://path/data/content/bundle.js:7270:25',
347+
fileName: 'resource://path/data/content/bundle.js',
348+
lineNumber: 5529,
349+
columnNumber: 16,
350+
message: 'this.props.raw[this.state.dataSource].rows is undefined',
351+
name: 'TypeError'
352+
};
353+
343354
module.exports = CapturedExceptions;

test/vendor/tracekit-parser.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,13 @@ describe('TraceKit', function () {
209209
assert.deepEqual(stackFrames.stack[1], { url: 'http://path/to/file.js', func: 'foo', args: [], line: 4283, column: null });
210210
assert.deepEqual(stackFrames.stack[2], { url: 'http://path/to/file.js', func: '?', args: [], line: 4287, column: null });
211211
});
212+
213+
it('should parse Firefox errors with resource: URLs', function () {
214+
var stackFrames = TraceKit.computeStackTrace(CapturedExceptions.FIREFOX_50_RESOURCE_URL);
215+
assert.ok(stackFrames);
216+
assert.deepEqual(stackFrames.stack.length, 3);
217+
assert.deepEqual(stackFrames.stack[0], { url: 'resource://path/data/content/bundle.js', func: 'render', args: [], line: 5529, column: 16 });
218+
});
219+
212220
});
213221
});

0 commit comments

Comments
 (0)