Skip to content

Commit

Permalink
3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Jul 27, 2016
1 parent 492f4bf commit 0ca6591
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 35 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.3.0
* NEW: Can now specify `environment` configuration option. See: https://github.com/getsentry/raven-js/pull/661
* CHANGE: Raven.js now serializes data payload w/ json-stringify-safe to avoid circular references. See: https://github.com/getsentry/raven-js/pull/652
* BUGFIX: Angular 1.x plugin no longer clobbers user-specified `dataCallback`. See: https://github.com/getsentry/raven-js/pull/658

## 3.2.1
* BUGFIX: Fixed error when manually calling captureException with Error objects w/ maxMessageLength > 0. See: https://github.com/getsentry/raven-js/pull/647
* BUGFIX: Fixed TypeScript language declaration file for compatibility w/ Webpack loaders. See: https://github.com/getsentry/raven-js/pull/645
Expand Down
5 changes: 3 additions & 2 deletions dist/plugins/angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.2.1 (bbd229d) | github.com/getsentry/raven-js */
/*! Raven.js 3.2.1 (492f4bf) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down Expand Up @@ -50,7 +50,7 @@ function angularPlugin(Raven, angular) {
.provider('Raven', RavenProvider)
.config(['$provide', ExceptionHandlerProvider]);

Raven.setDataCallback(function(data) {
Raven.setDataCallback(function(data, original) {
// We only care about mutating an exception
var exception = data.exception;
if (exception) {
Expand All @@ -66,6 +66,7 @@ function angularPlugin(Raven, angular) {
data.extra.angularDocs = matches[3].substr(0, 250);
}
}
original && original(data);
});
}

Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/angular.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/angular.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.2.1 (bbd229d) | github.com/getsentry/raven-js */
/*! Raven.js 3.2.1 (492f4bf) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/console.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/ember.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.2.1 (bbd229d) | github.com/getsentry/raven-js */
/*! Raven.js 3.2.1 (492f4bf) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/ember.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/require.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.2.1 (bbd229d) | github.com/getsentry/raven-js */
/*! Raven.js 3.2.1 (492f4bf) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/require.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 61 additions & 15 deletions dist/raven.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.2.1 (bbd229d) | github.com/getsentry/raven-js */
/*! Raven.js 3.2.1 (492f4bf) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand All @@ -11,6 +11,35 @@
*/

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Raven = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
exports = module.exports = stringify
exports.getSerialize = serializer

function stringify(obj, replacer, spaces, cycleReplacer) {
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
}

function serializer(replacer, cycleReplacer) {
var stack = [], keys = []

if (cycleReplacer == null) cycleReplacer = function(key, value) {
if (stack[0] === value) return "[Circular ~]"
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
}

return function(key, value) {
if (stack.length > 0) {
var thisPos = stack.indexOf(this)
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
}
else stack.push(value)

return replacer == null ? value : replacer.call(this, key, value)
}
}

},{}],2:[function(_dereq_,module,exports){
'use strict';

function RavenConfigError(message) {
Expand All @@ -22,7 +51,7 @@ RavenConfigError.prototype.constructor = RavenConfigError;

module.exports = RavenConfigError;

},{}],2:[function(_dereq_,module,exports){
},{}],3:[function(_dereq_,module,exports){
'use strict';

var wrapMethod = function(console, level, callback) {
Expand Down Expand Up @@ -61,13 +90,14 @@ module.exports = {
wrapMethod: wrapMethod
};

},{}],3:[function(_dereq_,module,exports){
},{}],4:[function(_dereq_,module,exports){
/*global XDomainRequest:false*/
'use strict';

var TraceKit = _dereq_(6);
var RavenConfigError = _dereq_(1);
var utils = _dereq_(5);
var TraceKit = _dereq_(7);
var RavenConfigError = _dereq_(2);
var utils = _dereq_(6);
var stringify = _dereq_(1);

var isFunction = utils.isFunction;
var isUndefined = utils.isUndefined;
Expand All @@ -84,7 +114,7 @@ var htmlTreeAsString = utils.htmlTreeAsString;
var parseUrl = utils.parseUrl;
var isString = utils.isString;

var wrapConsoleMethod = _dereq_(2).wrapMethod;
var wrapConsoleMethod = _dereq_(3).wrapMethod;

var dsnKeys = 'source protocol user pass host port path'.split(' '),
dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
Expand Down Expand Up @@ -492,7 +522,20 @@ Raven.prototype = {
*/
getContext: function() {
// lol javascript
return JSON.parse(JSON.stringify(this._globalContext));
return JSON.parse(stringify(this._globalContext));
},


/*
* Set environment of application
*
* @param {string} environment Typically something like 'production'.
* @return {Raven}
*/
setEnvironment: function(environment) {
this._globalOptions.environment = environment;

return this;
},

/*
Expand Down Expand Up @@ -1249,6 +1292,9 @@ Raven.prototype = {
data.user = this._globalContext.user;
}

// Include the environment if it's defined in globalOptions
if (globalOptions.environment) data.environment = globalOptions.environment;

// Include the release if it's defined in globalOptions
if (globalOptions.release) data.release = globalOptions.release;

Expand Down Expand Up @@ -1362,7 +1408,7 @@ Raven.prototype = {
// NOTE: auth is intentionally sent as part of query string (NOT as custom
// HTTP header) so as to avoid preflight CORS requests
request.open('POST', url + '?' + urlencode(opts.auth));
request.send(JSON.stringify(opts.data));
request.send(stringify(opts.data));
},

_logDebug: function(level) {
Expand Down Expand Up @@ -1391,7 +1437,7 @@ Raven.prototype.setReleaseContext = Raven.prototype.setRelease;

module.exports = Raven;

},{"1":1,"2":2,"5":5,"6":6}],4:[function(_dereq_,module,exports){
},{"1":1,"2":2,"3":3,"6":6,"7":7}],5:[function(_dereq_,module,exports){
/**
* Enforces a single instance of the Raven client, and the
* main entry point for Raven. If you are a consumer of the
Expand All @@ -1400,7 +1446,7 @@ module.exports = Raven;

'use strict';

var RavenConstructor = _dereq_(3);
var RavenConstructor = _dereq_(4);

var _Raven = window.Raven;

Expand All @@ -1421,7 +1467,7 @@ Raven.afterLoad();

module.exports = Raven;

},{"3":3}],5:[function(_dereq_,module,exports){
},{"4":4}],6:[function(_dereq_,module,exports){
/*eslint no-extra-parens:0*/
'use strict';

Expand Down Expand Up @@ -1679,10 +1725,10 @@ module.exports = {
parseUrl: parseUrl
};

},{}],6:[function(_dereq_,module,exports){
},{}],7:[function(_dereq_,module,exports){
'use strict';

var utils = _dereq_(5);
var utils = _dereq_(6);

var hasKey = utils.hasKey;
var isString = utils.isString;
Expand Down Expand Up @@ -2460,5 +2506,5 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {

module.exports = TraceKit;

},{"5":5}]},{},[4])(4)
},{"6":6}]},{},[5])(5)
});
4 changes: 2 additions & 2 deletions dist/raven.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/raven.min.js.map

Large diffs are not rendered by default.

0 comments on commit 0ca6591

Please sign in to comment.