rollbar 2.26.1 → 2.26.3

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.
@@ -1423,6 +1423,9 @@ function Rollbar(options, client) {
1423
1423
  this.instrumenter.instrument();
1424
1424
  }
1425
1425
  _.setupJSON(polyfillJSON);
1426
+
1427
+ // Used with rollbar-react for rollbar-react-native compatibility.
1428
+ this.rollbar = this;
1426
1429
  }
1427
1430
 
1428
1431
  var _instance = null;
@@ -4692,7 +4695,7 @@ module.exports = {
4692
4695
 
4693
4696
 
4694
4697
  module.exports = {
4695
- version: '2.26.1',
4698
+ version: '2.26.3',
4696
4699
  endpoint: 'api.rollbar.com/api/1/item/',
4697
4700
  logLevel: 'debug',
4698
4701
  reportLevel: 'debug',
@@ -4794,8 +4797,8 @@ Telemeter.prototype.configure = function(options) {
4794
4797
  var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;
4795
4798
  var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));
4796
4799
  var deleteCount = 0;
4797
- if (this.maxQueueSize > newMaxEvents) {
4798
- deleteCount = this.maxQueueSize - newMaxEvents;
4800
+ if (this.queue.length > newMaxEvents) {
4801
+ deleteCount = this.queue.length - newMaxEvents;
4799
4802
  }
4800
4803
  this.maxQueueSize = newMaxEvents;
4801
4804
  this.queue.splice(0, deleteCount);
@@ -5144,7 +5147,9 @@ Instrumenter.prototype.instrumentNetwork = function() {
5144
5147
  var xhrp = this._window.XMLHttpRequest.prototype;
5145
5148
  replace(xhrp, 'open', function(orig) {
5146
5149
  return function(method, url) {
5147
- if (_.isType(url, 'string')) {
5150
+ var isUrlObject = _isUrlObject(url)
5151
+ if (_.isType(url, 'string') || isUrlObject) {
5152
+ url = isUrlObject ? url.toString() : url;
5148
5153
  if (this.__rollbar_xhr) {
5149
5154
  this.__rollbar_xhr.method = method;
5150
5155
  this.__rollbar_xhr.url = url;
@@ -5307,8 +5312,9 @@ Instrumenter.prototype.instrumentNetwork = function() {
5307
5312
  var input = args[0];
5308
5313
  var method = 'GET';
5309
5314
  var url;
5310
- if (_.isType(input, 'string')) {
5311
- url = input;
5315
+ var isUrlObject = _isUrlObject(input)
5316
+ if (_.isType(input, 'string') || isUrlObject) {
5317
+ url = isUrlObject ? input.toString() : input;
5312
5318
  } else if (input) {
5313
5319
  url = input.url;
5314
5320
  if (input.method) {
@@ -5735,6 +5741,10 @@ Instrumenter.prototype.removeListeners = function(section) {
5735
5741
  }
5736
5742
  };
5737
5743
 
5744
+ function _isUrlObject(input) {
5745
+ return typeof URL !== 'undefined' && input instanceof URL
5746
+ }
5747
+
5738
5748
  module.exports = Instrumenter;
5739
5749
 
5740
5750