@honeybadger-io/js 4.0.0-beta.1 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/honeybadger.js +13 -7
- package/dist/browser/honeybadger.js.map +1 -1
- package/dist/browser/honeybadger.min.js +1 -1
- package/dist/browser/honeybadger.min.js.map +1 -1
- package/dist/browser/types/core/util.d.ts +1 -1
- package/dist/server/honeybadger.js +13 -7
- package/dist/server/types/core/util.d.ts +1 -1
- package/package.json +1 -1
- package/dist/browser/types/core/error.d.ts +0 -3
- package/dist/server/types/core/error.d.ts +0 -3
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
return true;
|
|
272
272
|
}
|
|
273
273
|
// Returns a new object with properties from other object.
|
|
274
|
-
function
|
|
274
|
+
function shallowClone(obj) {
|
|
275
275
|
if (typeof (obj) !== 'object' || obj === null) {
|
|
276
276
|
return {};
|
|
277
277
|
}
|
|
@@ -298,8 +298,14 @@
|
|
|
298
298
|
return false;
|
|
299
299
|
}
|
|
300
300
|
function canSerialize(obj) {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
var typeOfObj = typeof obj;
|
|
302
|
+
// Functions are TMI
|
|
303
|
+
if (/function/.test(typeOfObj)) {
|
|
304
|
+
// Let special toJSON method pass as it's used by JSON.stringify (#722)
|
|
305
|
+
return obj.name === 'toJSON';
|
|
306
|
+
}
|
|
307
|
+
// Symbols can't convert to strings.
|
|
308
|
+
if (/symbol/.test(typeOfObj)) {
|
|
303
309
|
return false;
|
|
304
310
|
}
|
|
305
311
|
if (obj === null) {
|
|
@@ -395,7 +401,7 @@
|
|
|
395
401
|
notice = merge(thing, { name: e.name, message: e.message, stack: e.stack });
|
|
396
402
|
}
|
|
397
403
|
else if (typeof thing === 'object') {
|
|
398
|
-
notice =
|
|
404
|
+
notice = shallowClone(thing);
|
|
399
405
|
}
|
|
400
406
|
else {
|
|
401
407
|
var m = String(thing);
|
|
@@ -583,7 +589,7 @@
|
|
|
583
589
|
var notifier = {
|
|
584
590
|
name: 'honeybadger-js',
|
|
585
591
|
url: 'https://github.com/honeybadger-io/honeybadger-js',
|
|
586
|
-
version: '4.0.0-beta.
|
|
592
|
+
version: '4.0.0-beta.2'
|
|
587
593
|
};
|
|
588
594
|
// Split at commas and spaces
|
|
589
595
|
var TAG_SEPARATOR = /,|\s+/;
|
|
@@ -699,7 +705,7 @@
|
|
|
699
705
|
notice.__breadcrumbs = this.config.breadcrumbsEnabled ? breadcrumbs.slice() : [];
|
|
700
706
|
// we need to have the source file data before the beforeNotifyHandlers,
|
|
701
707
|
// in case they modify them
|
|
702
|
-
var sourceCodeData = notice && notice.backtrace ? notice.backtrace.map(function (trace) { return
|
|
708
|
+
var sourceCodeData = notice && notice.backtrace ? notice.backtrace.map(function (trace) { return shallowClone(trace); }) : null;
|
|
703
709
|
getSourceForBacktrace(sourceCodeData, this.__getSourceFileHandler, function (sourcePerTrace) {
|
|
704
710
|
sourcePerTrace.forEach(function (source, index) {
|
|
705
711
|
notice.backtrace[index].source = source;
|
|
@@ -800,7 +806,7 @@
|
|
|
800
806
|
return;
|
|
801
807
|
}
|
|
802
808
|
opts = opts || {};
|
|
803
|
-
var metadata =
|
|
809
|
+
var metadata = shallowClone(opts.metadata);
|
|
804
810
|
var category = opts.category || 'custom';
|
|
805
811
|
var timestamp = new Date().toISOString();
|
|
806
812
|
var store = this.__store.getStore();
|