@sentry/browser 6.17.6 → 6.17.7

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/build/bundle.js CHANGED
@@ -1,29 +1,31 @@
1
- /*! @sentry/browser 6.17.6 (4b4faec) | https://github.com/getsentry/sentry-javascript */
1
+ /*! @sentry/browser 6.17.7 (635dfc2) | https://github.com/getsentry/sentry-javascript */
2
2
  var Sentry = (function (exports) {
3
3
  /*! *****************************************************************************
4
- Copyright (c) Microsoft Corporation. All rights reserved.
5
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
6
- this file except in compliance with the License. You may obtain a copy of the
7
- License at http://www.apache.org/licenses/LICENSE-2.0
4
+ Copyright (c) Microsoft Corporation.
8
5
 
9
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
11
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
12
- MERCHANTABLITY OR NON-INFRINGEMENT.
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
13
8
 
14
- See the Apache Version 2.0 License for specific language governing permissions
15
- and limitations under the License.
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
16
  ***************************************************************************** */
17
17
  /* global Reflect, Promise */
18
18
 
19
19
  var extendStatics = function(d, b) {
20
20
  extendStatics = Object.setPrototypeOf ||
21
21
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
22
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
22
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
23
23
  return extendStatics(d, b);
24
24
  };
25
25
 
26
26
  function __extends(d, b) {
27
+ if (typeof b !== "function" && b !== null)
28
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
29
  extendStatics(d, b);
28
30
  function __() { this.constructor = d; }
29
31
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -41,14 +43,15 @@ var Sentry = (function (exports) {
41
43
  };
42
44
 
43
45
  function __values(o) {
44
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
46
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
45
47
  if (m) return m.call(o);
46
- return {
48
+ if (o && typeof o.length === "number") return {
47
49
  next: function () {
48
50
  if (o && i >= o.length) o = void 0;
49
51
  return { value: o && o[i++], done: !o };
50
52
  }
51
53
  };
54
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
52
55
  }
53
56
 
54
57
  function __read(o, n) {
@@ -68,6 +71,7 @@ var Sentry = (function (exports) {
68
71
  return ar;
69
72
  }
70
73
 
74
+ /** @deprecated */
71
75
  function __spread() {
72
76
  for (var ar = [], i = 0; i < arguments.length; i++)
73
77
  ar = ar.concat(__read(arguments[i]));
@@ -800,16 +804,18 @@ var Sentry = (function (exports) {
800
804
  source[name] = wrapped;
801
805
  }
802
806
  /**
803
- * Defines a non enumerable property. This creates a non enumerable property on an object.
807
+ * Defines a non-enumerable property on the given object.
804
808
  *
805
- * @param func The function to set a property to
806
- * @param name the name of the special sentry property
807
- * @param value the property to define
809
+ * @param obj The object on which to set the property
810
+ * @param name The name of the property to be set
811
+ * @param value The value to which to set the property
808
812
  */
809
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
810
- function addNonEnumerableProperty(func, name, value) {
811
- Object.defineProperty(func, name, {
813
+ function addNonEnumerableProperty(obj, name, value) {
814
+ Object.defineProperty(obj, name, {
815
+ // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
812
816
  value: value,
817
+ writable: true,
818
+ configurable: true,
813
819
  });
814
820
  }
815
821
  /**
@@ -1332,7 +1338,7 @@ var Sentry = (function (exports) {
1332
1338
  if (!(level in global$2.console)) {
1333
1339
  return;
1334
1340
  }
1335
- fill(global$2.console, level, function (originalConsoleLevel) {
1341
+ fill(global$2.console, level, function (originalConsoleMethod) {
1336
1342
  return function () {
1337
1343
  var args = [];
1338
1344
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -1340,8 +1346,8 @@ var Sentry = (function (exports) {
1340
1346
  }
1341
1347
  triggerHandlers('console', { args: args, level: level });
1342
1348
  // this fails for some browsers. :(
1343
- if (originalConsoleLevel) {
1344
- Function.prototype.apply.call(originalConsoleLevel, global$2.console, args);
1349
+ if (originalConsoleMethod) {
1350
+ originalConsoleMethod.call(global$2.console, args);
1345
1351
  }
1346
1352
  };
1347
1353
  });
@@ -4465,7 +4471,7 @@ var Sentry = (function (exports) {
4465
4471
  hub.bindClient(client);
4466
4472
  }
4467
4473
 
4468
- var SDK_VERSION = '6.17.6';
4474
+ var SDK_VERSION = '6.17.7';
4469
4475
 
4470
4476
  var originalFunctionToString;
4471
4477
  /** Patch toString calls to return proper name for wrapped functions */
@@ -4695,7 +4701,7 @@ var Sentry = (function (exports) {
4695
4701
  // global reference to slice
4696
4702
  var UNKNOWN_FUNCTION = '?';
4697
4703
  // Chromium based browsers: Chrome, Brave, new Opera, new Edge
4698
- var chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
4704
+ var chrome = /^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
4699
4705
  // gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
4700
4706
  // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
4701
4707
  // We need this specific case for now because we want no other regex to match.
@@ -4749,7 +4755,7 @@ var Sentry = (function (exports) {
4749
4755
  /** JSDoc */
4750
4756
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, complexity
4751
4757
  function computeStackTraceFromStackProp(ex) {
4752
- var _a, _b;
4758
+ var e_1, _a, _b;
4753
4759
  if (!ex || !ex.stack) {
4754
4760
  return null;
4755
4761
  }
@@ -4759,74 +4765,66 @@ var Sentry = (function (exports) {
4759
4765
  var submatch;
4760
4766
  var parts;
4761
4767
  var element;
4762
- for (var i = 0; i < lines.length; ++i) {
4763
- if ((parts = chrome.exec(lines[i]))) {
4764
- var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
4765
- isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
4766
- if (isEval && (submatch = chromeEval.exec(parts[2]))) {
4767
- // throw out eval line/column and use top-most line/column number
4768
- parts[2] = submatch[1]; // url
4769
- parts[3] = submatch[2]; // line
4770
- parts[4] = submatch[3]; // column
4768
+ try {
4769
+ for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
4770
+ var line = lines_1_1.value;
4771
+ if ((parts = chrome.exec(line))) {
4772
+ isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
4773
+ if (isEval && (submatch = chromeEval.exec(parts[2]))) {
4774
+ // throw out eval line/column and use top-most line/column number
4775
+ parts[2] = submatch[1]; // url
4776
+ parts[3] = submatch[2]; // line
4777
+ parts[4] = submatch[3]; // column
4778
+ }
4779
+ // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
4780
+ // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
4781
+ var _c = __read(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2), func = _c[0], url = _c[1];
4782
+ element = {
4783
+ url: url,
4784
+ func: func,
4785
+ line: parts[3] ? +parts[3] : null,
4786
+ column: parts[4] ? +parts[4] : null,
4787
+ };
4771
4788
  }
4772
- // Arpad: Working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `
4773
- // prefix here seems like the quickest solution for now.
4774
- var url = parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2];
4775
- // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
4776
- // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
4777
- var func = parts[1] || UNKNOWN_FUNCTION;
4778
- _a = __read(extractSafariExtensionDetails(func, url), 2), func = _a[0], url = _a[1];
4779
- element = {
4780
- url: url,
4781
- func: func,
4782
- args: isNative ? [parts[2]] : [],
4783
- line: parts[3] ? +parts[3] : null,
4784
- column: parts[4] ? +parts[4] : null,
4785
- };
4786
- }
4787
- else if ((parts = winjs.exec(lines[i]))) {
4788
- element = {
4789
- url: parts[2],
4790
- func: parts[1] || UNKNOWN_FUNCTION,
4791
- args: [],
4792
- line: +parts[3],
4793
- column: parts[4] ? +parts[4] : null,
4794
- };
4795
- }
4796
- else if ((parts = gecko.exec(lines[i]))) {
4797
- isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
4798
- if (isEval && (submatch = geckoEval.exec(parts[3]))) {
4799
- // throw out eval line/column and use top-most line number
4800
- parts[1] = parts[1] || "eval";
4801
- parts[3] = submatch[1];
4802
- parts[4] = submatch[2];
4803
- parts[5] = ''; // no column when eval
4789
+ else if ((parts = winjs.exec(line))) {
4790
+ element = {
4791
+ url: parts[2],
4792
+ func: parts[1] || UNKNOWN_FUNCTION,
4793
+ line: +parts[3],
4794
+ column: parts[4] ? +parts[4] : null,
4795
+ };
4804
4796
  }
4805
- else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {
4806
- // FireFox uses this awesome columnNumber property for its top frame
4807
- // Also note, Firefox's column number is 0-based and everything else expects 1-based,
4808
- // so adding 1
4809
- // NOTE: this hack doesn't work if top-most frame is eval
4810
- stack[0].column = ex.columnNumber + 1;
4797
+ else if ((parts = gecko.exec(line))) {
4798
+ isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
4799
+ if (isEval && (submatch = geckoEval.exec(parts[3]))) {
4800
+ // throw out eval line/column and use top-most line number
4801
+ parts[1] = parts[1] || "eval";
4802
+ parts[3] = submatch[1];
4803
+ parts[4] = submatch[2];
4804
+ parts[5] = ''; // no column when eval
4805
+ }
4806
+ var url = parts[3];
4807
+ var func = parts[1] || UNKNOWN_FUNCTION;
4808
+ _b = __read(extractSafariExtensionDetails(func, url), 2), func = _b[0], url = _b[1];
4809
+ element = {
4810
+ url: url,
4811
+ func: func,
4812
+ line: parts[4] ? +parts[4] : null,
4813
+ column: parts[5] ? +parts[5] : null,
4814
+ };
4811
4815
  }
4812
- var url = parts[3];
4813
- var func = parts[1] || UNKNOWN_FUNCTION;
4814
- _b = __read(extractSafariExtensionDetails(func, url), 2), func = _b[0], url = _b[1];
4815
- element = {
4816
- url: url,
4817
- func: func,
4818
- args: parts[2] ? parts[2].split(',') : [],
4819
- line: parts[4] ? +parts[4] : null,
4820
- column: parts[5] ? +parts[5] : null,
4821
- };
4822
- }
4823
- else {
4824
- continue;
4816
+ else {
4817
+ continue;
4818
+ }
4819
+ stack.push(element);
4825
4820
  }
4826
- if (!element.func && element.line) {
4827
- element.func = UNKNOWN_FUNCTION;
4821
+ }
4822
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4823
+ finally {
4824
+ try {
4825
+ if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
4828
4826
  }
4829
- stack.push(element);
4827
+ finally { if (e_1) throw e_1.error; }
4830
4828
  }
4831
4829
  if (!stack.length) {
4832
4830
  return null;
@@ -4848,7 +4846,7 @@ var Sentry = (function (exports) {
4848
4846
  // reliably in other circumstances.
4849
4847
  var stacktrace = ex.stacktrace;
4850
4848
  var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
4851
- var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i;
4849
+ var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
4852
4850
  var lines = stacktrace.split('\n');
4853
4851
  var stack = [];
4854
4852
  var parts;
@@ -4858,16 +4856,14 @@ var Sentry = (function (exports) {
4858
4856
  element = {
4859
4857
  url: parts[2],
4860
4858
  func: parts[3],
4861
- args: [],
4862
4859
  line: +parts[1],
4863
4860
  column: null,
4864
4861
  };
4865
4862
  }
4866
4863
  else if ((parts = opera11Regex.exec(lines[line]))) {
4867
4864
  element = {
4868
- url: parts[6],
4865
+ url: parts[5],
4869
4866
  func: parts[3] || parts[4],
4870
- args: parts[5] ? parts[5].split(',') : [],
4871
4867
  line: +parts[1],
4872
4868
  column: +parts[2],
4873
4869
  };