@microsoft/applicationinsights-react-js 17.0.3 → 17.0.4-nightly.2401-18

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Plugin, 17.0.3
2
+ * Application Insights JavaScript SDK - React Plugin, 17.0.4-nightly.2401-18
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -58,6 +58,7 @@
58
58
  var VALUE = "value";
59
59
  var NAME = "name";
60
60
  var SLICE = "slice";
61
+ var CALL = "call";
61
62
  var ObjClass = Object;
62
63
  var ObjProto = ObjClass[PROTOTYPE];
63
64
  var StrCls = String;
@@ -88,7 +89,7 @@
88
89
  };
89
90
  }
90
91
  function objToString(value) {
91
- return ObjProto.toString.call(value);
92
+ return ObjProto.toString[CALL](value);
92
93
  }
93
94
  function isUndefined(value) {
94
95
  return typeof value === UNDEFINED || value === UNDEFINED;
@@ -102,8 +103,8 @@
102
103
  function isDefined(arg) {
103
104
  return !!arg || arg !== UNDEF_VALUE;
104
105
  }
105
- var isString = _createIs(STRING);
106
- var isFunction = _createIs(FUNCTION);
106
+ var isString = ( _createIs(STRING));
107
+ var isFunction = ( _createIs(FUNCTION));
107
108
  function isObject(value) {
108
109
  if (!value && isNullOrUndefined(value)) {
109
110
  return false;
@@ -111,8 +112,8 @@
111
112
  return !!value && typeof value === OBJECT;
112
113
  }
113
114
  var isArray = ArrCls.isArray;
114
- var isNumber = _createIs(NUMBER);
115
- var isError = _createObjIs("Error");
115
+ var isNumber = ( _createIs(NUMBER));
116
+ var isError = ( _createObjIs("Error"));
116
117
  function isTruthy(value) {
117
118
  return !(!value || safeGet(function () { return !(value && (0 + value)); }, !value));
118
119
  }
@@ -120,7 +121,7 @@
120
121
  var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;
121
122
 
122
123
  function objHasOwnProperty(obj, prop) {
123
- return obj && ObjProto.hasOwnProperty.call(obj, prop);
124
+ return obj && ObjProto.hasOwnProperty[CALL](obj, prop);
124
125
  }
125
126
 
126
127
  var objHasOwn = ObjClass["hasOwn"] || polyObjHasOwn;
@@ -132,7 +133,7 @@
132
133
  if (theObject && isObject(theObject)) {
133
134
  for (var prop in theObject) {
134
135
  if (objHasOwn(theObject, prop)) {
135
- if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {
136
+ if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) {
136
137
  break;
137
138
  }
138
139
  }
@@ -169,8 +170,12 @@
169
170
  }
170
171
 
171
172
  var _objFreeze = ObjClass["freeze"];
172
- var _doNothing = function (value) { return value; };
173
- var _getProto = function (value) { return value[__PROTO__] || NULL_VALUE; };
173
+ function _doNothing(value) {
174
+ return value;
175
+ }
176
+ function _getProto(value) {
177
+ return value[__PROTO__] || NULL_VALUE;
178
+ }
174
179
  var objAssign = ObjClass["assign"];
175
180
  function objKeys(value) {
176
181
  if (!isObject(value) || value === NULL_VALUE) {
@@ -201,7 +206,7 @@
201
206
  return _createKeyValueMap(values, 0 , 0 , objDeepFreeze);
202
207
  }
203
208
 
204
- var _wellKnownSymbolMap = createEnumKeyMap({
209
+ var _wellKnownSymbolMap = createEnumKeyMap({
205
210
  asyncIterator: 0 ,
206
211
  hasInstance: 1 ,
207
212
  isConcatSpreadable: 2 ,
@@ -261,43 +266,46 @@
261
266
  return objToString(object) + ": " + propertyValueDump;
262
267
  }
263
268
 
264
- var _arrSlice = ArrProto[SLICE];
265
- var _throwMissingFunction = function (funcName, thisArg) {
269
+ var _slice;
270
+ function _throwMissingFunction(funcName, thisArg) {
266
271
  throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg));
267
- };
268
- var _unwrapInstFunction = function (funcName) {
272
+ }
273
+ function _unwrapInstFunction(funcName) {
274
+ _slice = _slice || ArrProto[SLICE];
269
275
  return function (thisArg) {
270
- return thisArg[funcName].apply(thisArg, _arrSlice.call(arguments, 1));
276
+ return thisArg[funcName].apply(thisArg, _slice[CALL](arguments, 1));
271
277
  };
272
- };
273
- var _unwrapFunction = function (funcName, clsProto) {
278
+ }
279
+ function _unwrapFunction(funcName, clsProto) {
280
+ _slice = _slice || ArrProto[SLICE];
274
281
  var clsFn = clsProto && clsProto[funcName];
275
282
  return function (thisArg) {
276
283
  var theFunc = (thisArg && thisArg[funcName]) || clsFn;
277
284
  if (theFunc) {
278
- return theFunc.apply(thisArg, _arrSlice.call(arguments, 1));
285
+ return theFunc.apply(thisArg, _slice[CALL](arguments, 1));
279
286
  }
280
287
  _throwMissingFunction(funcName, thisArg);
281
288
  };
282
- };
283
- var _unwrapFunctionWithPoly = function (funcName, clsProto, polyFunc) {
289
+ }
290
+ function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
291
+ _slice = _slice || ArrProto[SLICE];
284
292
  var clsFn = clsProto && clsProto[funcName];
285
293
  return function (thisArg) {
286
294
  var theFunc = (thisArg && thisArg[funcName]) || clsFn;
287
295
  if (theFunc || polyFunc) {
288
296
  var theArgs = arguments;
289
- return (theFunc || polyFunc).apply(thisArg, theFunc ? _arrSlice.call(theArgs, 1) : theArgs);
297
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? _slice[CALL](theArgs, 1) : theArgs);
290
298
  }
291
299
  _throwMissingFunction(funcName, thisArg);
292
300
  };
293
- };
301
+ }
294
302
 
295
303
  var mathMax = MathCls.max;
296
304
 
297
- var strSlice = _unwrapFunction(SLICE, StrProto);
305
+ var strSlice = ( _unwrapFunction(SLICE, StrProto));
298
306
 
299
- var strSubstring = _unwrapFunction("substring", StrProto);
300
- _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr);
307
+ var strSubstring = ( _unwrapFunction("substring", StrProto));
308
+ ( _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
301
309
  function polyStrSubstr(value, start, length) {
302
310
  if (isNullOrUndefined(value)) {
303
311
  throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
@@ -327,7 +335,7 @@
327
335
  }
328
336
  return _polySymbols;
329
337
  }
330
- var _wellKnownSymbolCache = {};
338
+ var _wellKnownSymbolCache;
331
339
  function polyNewSymbol(description) {
332
340
  var theSymbol = {
333
341
  description: asString(description),
@@ -348,6 +356,7 @@
348
356
  return registry.k[key];
349
357
  }
350
358
  function polyGetKnownSymbol(name) {
359
+ !_wellKnownSymbolCache && (_wellKnownSymbolCache = {});
351
360
  var result;
352
361
  var knownName = _wellKnownSymbolMap[name];
353
362
  if (knownName) {
@@ -440,12 +449,14 @@
440
449
  var _cachedWindow;
441
450
  var _cachedDocument;
442
451
  var _cachedNavigator;
443
- var lazySafeGetInst = function (name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); };
444
- var getGlobal = function (useCached) {
452
+ function lazySafeGetInst(name) {
453
+ return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
454
+ }
455
+ function getGlobal(useCached) {
445
456
  (!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));
446
457
  return _cachedGlobal.v;
447
- };
448
- var getInst = function (name, useCached) {
458
+ }
459
+ function getInst(name, useCached) {
449
460
  var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v;
450
461
  if (gbl && gbl[name]) {
451
462
  return gbl[name];
@@ -454,20 +465,22 @@
454
465
  return _cachedWindow.v;
455
466
  }
456
467
  return NULL_VALUE;
457
- };
458
- var getDocument = function () {
468
+ }
469
+ function getDocument() {
459
470
  (!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
460
471
  return _cachedDocument.v;
461
- };
462
- var hasWindow = function () { return !!getWindow(); };
463
- var getWindow = function () {
472
+ }
473
+ function hasWindow() {
474
+ return !!getWindow();
475
+ }
476
+ function getWindow() {
464
477
  (!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
465
478
  return _cachedWindow.v;
466
- };
467
- var getNavigator = function () {
479
+ }
480
+ function getNavigator() {
468
481
  (!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
469
482
  return _cachedNavigator.v;
470
- };
483
+ }
471
484
 
472
485
  var _symbol;
473
486
  var _symbolFor;
@@ -518,7 +531,7 @@
518
531
  try {
519
532
  var count = 0;
520
533
  while (!(iterResult = iter.next())[DONE]) {
521
- if (callbackfn.call(thisArg || iter, iterResult[VALUE], count, iter) === -1) {
534
+ if (callbackfn[CALL](thisArg || iter, iterResult[VALUE], count, iter) === -1) {
522
535
  break;
523
536
  }
524
537
  count++;
@@ -547,7 +560,7 @@
547
560
  }
548
561
  }
549
562
 
550
- var fnApply = _unwrapInstFunction("apply");
563
+ var fnApply = ( _unwrapInstFunction("apply"));
551
564
 
552
565
  function arrAppend(target, elms) {
553
566
  if (!isUndefined(elms) && target) {
@@ -571,7 +584,7 @@
571
584
  var len = theArray[LENGTH] >>> 0;
572
585
  for (var idx = 0; idx < len; idx++) {
573
586
  if (idx in theArray) {
574
- if (callbackfn.call(thisArg || theArray, theArray[idx], idx, theArray) === -1) {
587
+ if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
575
588
  break;
576
589
  }
577
590
  }
@@ -579,15 +592,12 @@
579
592
  }
580
593
  }
581
594
 
582
- var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);
583
- _unwrapFunction(LAST_INDEX_OF, ArrProto);
584
-
585
- var arrSlice = _unwrapFunction(SLICE, ArrProto);
595
+ var arrIndexOf = ( _unwrapFunction(INDEX_OF, ArrProto));
596
+ ( _unwrapFunction(LAST_INDEX_OF, ArrProto));
586
597
 
587
- var fnCall = _unwrapInstFunction("call");
598
+ var arrSlice = ( _unwrapFunction(SLICE, ArrProto));
588
599
 
589
- var _objCreate = ObjClass["create"];
590
- var objCreate = _objCreate || polyObjCreate;
600
+ var objCreate = ObjClass["create"] || polyObjCreate;
591
601
  function polyObjCreate(obj) {
592
602
  if (!obj) {
593
603
  return {};
@@ -614,7 +624,7 @@
614
624
  return fn(obj, proto);
615
625
  }
616
626
 
617
- var _createCustomError = function (name, d, b) {
627
+ function _createCustomError(name, d, b) {
618
628
  _safeDefineName(d, name);
619
629
  d = objSetPrototypeOf(d, b);
620
630
  function __() {
@@ -623,21 +633,21 @@
623
633
  }
624
634
  d[PROTOTYPE] = b === NULL_VALUE ? objCreate(b) : (__[PROTOTYPE] = b[PROTOTYPE], new __());
625
635
  return d;
626
- };
627
- var _safeSetName = function (baseClass, name) {
636
+ }
637
+ function _safeSetName(baseClass, name) {
628
638
  try {
629
639
  name && (baseClass[NAME] = name);
630
640
  }
631
641
  catch (e) {
632
642
  }
633
- };
634
- var _safeDefineName = function (target, name) {
643
+ }
644
+ function _safeDefineName(target, name) {
635
645
  try {
636
646
  objDefine(target, NAME, { v: name, c: true, e: false });
637
647
  }
638
648
  catch (e) {
639
649
  }
640
- };
650
+ }
641
651
  function createCustomError(name, constructCb, errorBase) {
642
652
  var theBaseClass = errorBase || Error;
643
653
  var orgName = theBaseClass[PROTOTYPE][NAME];
@@ -681,13 +691,13 @@
681
691
  return value;
682
692
  };
683
693
  }
684
- var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
685
- var polyStrTrimStart = _createTrimFn(/^\s+/g);
686
- var polyStrTrimEnd = _createTrimFn(/(?=\s)\s+$/g);
694
+ var polyStrTrim = ( _createTrimFn(/^\s+|(?=\s)\s+$/g));
695
+ var polyStrTrimStart = ( _createTrimFn(/^\s+/g));
696
+ var polyStrTrimEnd = ( _createTrimFn(/(?=\s)\s+$/g));
687
697
 
688
- var strTrim = _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim);
689
- _unwrapFunctionWithPoly("trimStart", StrProto, polyStrTrimStart);
690
- _unwrapFunctionWithPoly("trimEnd", StrProto, polyStrTrimEnd);
698
+ var strTrim = ( _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim));
699
+ ( _unwrapFunctionWithPoly("trimStart", StrProto, polyStrTrimStart));
700
+ ( _unwrapFunctionWithPoly("trimEnd", StrProto, polyStrTrimEnd));
691
701
 
692
702
  var _fnToString;
693
703
  var _objCtrFnString;
@@ -703,7 +713,7 @@
703
713
  if (value !== _gblWindow) {
704
714
  if (!_objCtrFnString) {
705
715
  _fnToString = Function[PROTOTYPE].toString;
706
- _objCtrFnString = fnCall(_fnToString, ObjClass);
716
+ _objCtrFnString = _fnToString[CALL](ObjClass);
707
717
  }
708
718
  try {
709
719
  var proto = objGetPrototypeOf(value);
@@ -712,7 +722,7 @@
712
722
  if (objHasOwnProperty(proto, CONSTRUCTOR)) {
713
723
  proto = proto[CONSTRUCTOR];
714
724
  }
715
- result = proto && typeof proto === FUNCTION && _fnToString.call(proto) === _objCtrFnString;
725
+ result = proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString;
716
726
  }
717
727
  }
718
728
  catch (ex) {
@@ -721,7 +731,7 @@
721
731
  return result;
722
732
  }
723
733
 
724
- var strEndsWith = _unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith);
734
+ var strEndsWith = ( _unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
725
735
  function polyStrEndsWith(value, searchString, length) {
726
736
  if (!isString(value)) {
727
737
  throwTypeError("'" + dumpObj(value) + "' is not a string");
@@ -733,8 +743,8 @@
733
743
  return strSubstring(value, end - chkLen, end) === searchValue;
734
744
  }
735
745
 
736
- var strIndexOf = _unwrapFunction(INDEX_OF, StrProto);
737
- _unwrapFunction(LAST_INDEX_OF, StrProto);
746
+ var strIndexOf = ( _unwrapFunction(INDEX_OF, StrProto));
747
+ ( _unwrapFunction(LAST_INDEX_OF, StrProto));
738
748
 
739
749
  var REF = "ref";
740
750
  var UNREF = "un" + REF;
@@ -935,13 +945,13 @@
935
945
  }
936
946
  }
937
947
  function _isDynamicCandidate(target, funcName, skipOwn) {
938
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)));
948
+ return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);
939
949
  }
940
950
  function _throwTypeError(message) {
941
951
  throwTypeError("DynamicProto: " + message);
942
952
  }
943
953
  function _getInstanceFuncs(thisTarget) {
944
- var instFuncs = {};
954
+ var instFuncs = objCreate(null);
945
955
  _forEachProp(thisTarget, function (name) {
946
956
  if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
947
957
  instFuncs[name] = thisTarget[name];
@@ -970,7 +980,7 @@
970
980
  return theFunc.apply(target, arguments);
971
981
  };
972
982
  }
973
- var baseFuncs = {};
983
+ var baseFuncs = objCreate(null);
974
984
  _forEachProp(instFuncs, function (name) {
975
985
  baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
976
986
  });
@@ -990,8 +1000,8 @@
990
1000
  function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
991
1001
  var instFunc = null;
992
1002
  if (target && objHasOwnProperty(proto, DynClassName)) {
993
- var instFuncTable = target[DynInstFuncTable] || {};
994
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
1003
+ var instFuncTable = target[DynInstFuncTable] || objCreate(null);
1004
+ instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];
995
1005
  if (!instFunc) {
996
1006
  _throwTypeError("Missing [" + funcName + "] " + strFunction);
997
1007
  }
@@ -1041,20 +1051,24 @@
1041
1051
  return dynProtoProxy;
1042
1052
  }
1043
1053
  if (!_isObjectOrArrayPrototype(proto)) {
1044
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
1045
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
1046
- if (instFuncTable[DynAllowInstChkTag] !== false) {
1047
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
1048
- }
1049
- _forEachProp(target, function (name) {
1050
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
1051
- instFuncs_1[name] = target[name];
1052
- delete target[name];
1053
- if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
1054
- proto[name] = _createDynamicPrototype(proto, name);
1055
- }
1054
+ var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);
1055
+ if (!_isObjectOrArrayPrototype(instFuncTable)) {
1056
+ var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || objCreate(null));
1057
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
1058
+ instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
1059
+ }
1060
+ if (!_isObjectOrArrayPrototype(instFuncs_1)) {
1061
+ _forEachProp(target, function (name) {
1062
+ if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
1063
+ instFuncs_1[name] = target[name];
1064
+ delete target[name];
1065
+ if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
1066
+ proto[name] = _createDynamicPrototype(proto, name);
1067
+ }
1068
+ }
1069
+ });
1056
1070
  }
1057
- });
1071
+ }
1058
1072
  }
1059
1073
  }
1060
1074
  function _checkPrototype(classProto, thisTarget) {