@microsoft/applicationinsights-common 3.4.2-nightly3.2605-06 → 3.4.2-nightly3.2605-11

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,18 +1,18 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Common, 3.4.2-nightly3.2605-06
2
+ * Application Insights JavaScript SDK - Common, 3.4.2-nightly3.2605-11
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  'use strict';
6
6
 
7
7
 
8
- /*! https://github.com/nevware21/ts-utils v0.13.0 */
8
+ /*! https://github.com/nevware21/ts-utils v0.14.0 */
9
9
  /*#__NO_SIDE_EFFECTS__*/
10
10
  function _pureAssign(func1, func2) {
11
11
  return func1 || func2;
12
12
  }
13
13
  /*#__NO_SIDE_EFFECTS__*/
14
14
  function _pureRef(value, name) {
15
- return value[name];
15
+ return value !== null && value !== undefined ? value[name] : undefined;
16
16
  }
17
17
  var UNDEF_VALUE = undefined;
18
18
  var NULL_VALUE = null;
@@ -153,7 +153,7 @@ function objForEachKey(theObject, callbackfn, thisArg) {
153
153
  if (theObject && (isObject(theObject) || isFunction(theObject))) {
154
154
  for (var prop in theObject) {
155
155
  if (objHasOwn(theObject, prop)) {
156
- if (callbackfn[CALL](thisArg || theObject, prop, theObject[prop]) === -1) {
156
+ if (callbackfn[CALL](isStrictNullOrUndefined(thisArg) ? theObject : thisArg, prop, theObject[prop]) === -1) {
157
157
  break;
158
158
  }
159
159
  }
@@ -165,14 +165,14 @@ function arrForEach(theArray, callbackfn, thisArg) {
165
165
  var len = theArray[LENGTH] >>> 0;
166
166
  for (var idx = 0; idx < len; idx++) {
167
167
  if (idx in theArray) {
168
- if (callbackfn[CALL](thisArg || theArray, theArray[idx], idx, theArray) === -1) {
168
+ if (callbackfn[CALL](isStrictNullOrUndefined(thisArg) ? theArray : thisArg, theArray[idx], idx, theArray) === -1) {
169
169
  break;
170
170
  }
171
171
  }
172
172
  }
173
173
  }
174
174
  }
175
- var _unwrapFunction = ( _unwrapFunctionWithPoly);
175
+ var _unwrapFunction = _unwrapFunctionWithPoly;
176
176
  /*#__NO_SIDE_EFFECTS__*/
177
177
  function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
178
178
  var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
@@ -185,24 +185,36 @@ function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
185
185
  throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
186
186
  };
187
187
  }
188
+ /*#__NO_SIDE_EFFECTS__*/
189
+ function _unwrapFunctionNoInstWithPoly(funcName, clsProto, polyFunc) {
190
+ var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
191
+ return function (thisArg) {
192
+ var theFunc = clsFn;
193
+ if (theFunc || polyFunc) {
194
+ var theArgs = arguments;
195
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
196
+ }
197
+ throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
198
+ };
199
+ }
188
200
  function _objPropertyIsEnum(obj, propKey) {
189
201
  var desc;
190
202
  var fn = ObjClass$1.getOwnPropertyDescriptor;
191
203
  if (!isStrictNullOrUndefined(obj) && fn) {
192
204
  desc = safe(fn, [obj, propKey]).v || NULL_VALUE;
193
205
  }
194
- if (!desc) {
206
+ if (!desc && !isStrictNullOrUndefined(obj)) {
195
207
  desc = safe(function () {
196
208
  for (var key in obj) {
197
- if (key === propKey) {
198
- return { enumerable: true };
209
+ if (key == propKey) {
210
+ return { enumerable: objHasOwnProperty(obj, key) };
199
211
  }
200
212
  }
201
213
  }).v;
202
214
  }
203
215
  return (desc && desc.enumerable) || false;
204
216
  }
205
- var objPropertyIsEnumerable = ( /*#__PURE__*/_unwrapFunctionWithPoly("propertyIsEnumerable", NULL_VALUE, _objPropertyIsEnum));
217
+ var _objPropertyIsEnumerable = ( /*#__PURE__*/_unwrapFunctionNoInstWithPoly("propertyIsEnumerable", ObjProto$1, _objPropertyIsEnum));
206
218
  var _objGetOwnPropertyDescriptor$1 = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
207
219
  var _objGetOwnPropertySymbols = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, GET_OWN_PROPERTY_SYMBOLS)), _returnEmptyArray));
208
220
  var propMap = {
@@ -243,7 +255,7 @@ function objDefineProps(target, propDescMap) {
243
255
  props[key] = _createProp(value);
244
256
  });
245
257
  arrForEach(_objGetOwnPropertySymbols(propDescMap), function (sym) {
246
- if (objPropertyIsEnumerable(propDescMap, sym)) {
258
+ if (_objPropertyIsEnumerable(propDescMap, sym)) {
247
259
  props[sym] = _createProp(propDescMap[sym]);
248
260
  }
249
261
  });
@@ -610,6 +622,7 @@ function symbolFor(key) {
610
622
  }
611
623
  var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
612
624
  var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
625
+ var mathFloor = ( /*#__PURE__*/_pureRef(MathCls, "floor"));
613
626
  var arrReduce = ( /*#__PURE__*/_unwrapFunction("reduce", ArrProto));
614
627
  var _isProtoArray;
615
628
  var objSetPrototypeOf = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, "setPrototypeOf")), _polyObjSetPrototypeOf));
@@ -659,19 +672,20 @@ function createCustomError(name, constructCb, errorBase, superArgsFn) {
659
672
  }
660
673
  }, theBaseClass);
661
674
  }
675
+ var strReplace = ( /*#__PURE__*/_unwrapFunction("replace", StrProto));
662
676
  /*#__NO_SIDE_EFFECTS__*/
663
677
  function _createTrimFn(exp) {
664
678
  return function _doTrim(value) {
665
679
  _throwIfNullOrUndefined(value);
666
- if (value && value.replace) {
667
- value = value.replace(exp, EMPTY);
680
+ value = asString(value);
681
+ if (value) {
682
+ value = strReplace(value, exp, EMPTY);
668
683
  }
669
684
  return value;
670
685
  };
671
686
  }
672
687
  var polyStrTrim = ( /*#__PURE__*/_createTrimFn(/^\s+|(?=\s)\s+$/g));
673
688
  var strTrim = ( /*#__PURE__*/_unwrapFunctionWithPoly("trim", StrProto, polyStrTrim));
674
- var mathFloor = ( /*#__PURE__*/_pureRef(MathCls, "floor"));
675
689
  /*#__NO_SIDE_EFFECTS__*/
676
690
  function safeGetDeferred(cb, defValue, argArray) {
677
691
  return getDeferred(function () {
@@ -679,6 +693,7 @@ function safeGetDeferred(cb, defValue, argArray) {
679
693
  return result.e ? defValue : result.v;
680
694
  });
681
695
  }
696
+ var objGetOwnPropertyDescriptor = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
682
697
  var _fnToString;
683
698
  var _objCtrFnString;
684
699
  var _gblWindow;
@@ -722,7 +737,7 @@ function getPerformance() {
722
737
  return _perf.v;
723
738
  }
724
739
  var mathRound = ( /*#__PURE__*/_pureRef(MathCls, "round"));
725
- var objGetOwnPropertyDescriptor = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
740
+ var strIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", StrProto));
726
741
  var strEndsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
727
742
  /*#__NO_SIDE_EFFECTS__*/
728
743
  function polyStrEndsWith(value, searchString, length) {
@@ -731,7 +746,6 @@ function polyStrEndsWith(value, searchString, length) {
731
746
  var end = (!isUndefined(length) && length < value[LENGTH]) ? length : value[LENGTH];
732
747
  return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
733
748
  }
734
- var strIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", StrProto));
735
749
  var REF = "ref";
736
750
  var UNREF = "unref";
737
751
  var HAS_REF = "hasRef";
@@ -978,9 +992,11 @@ var strFunction = 'function';
978
992
  var DynInstFuncTable = '_dynInstFuncs';
979
993
  var DynProxyTag = '_isDynProxy';
980
994
  var DynClassName = '_dynClass';
995
+ var DynBaseProtoFuncs = '_dynBaseFuncs';
981
996
  var DynClassNamePrefix = '_dynCls$';
982
997
  var DynInstChkTag = '_dynInstChk';
983
998
  var DynAllowInstChkTag = DynInstChkTag;
999
+ var DynResolvedCachePrefix = '_dyn_r$';
984
1000
  var DynProtoDefaultOptions = '_dfOpts';
985
1001
  var UnknownValue = '_unknown_';
986
1002
  var str__Proto = "__proto__";
@@ -1063,6 +1079,25 @@ function _hasVisited(values, value) {
1063
1079
  }
1064
1080
  return false;
1065
1081
  }
1082
+ function _getBaseProtoFuncs(classProto) {
1083
+ if (objHasOwnProperty(classProto, DynBaseProtoFuncs)) {
1084
+ return classProto[DynBaseProtoFuncs];
1085
+ }
1086
+ var baseFuncSources = objCreate(null);
1087
+ var baseProto = _getObjProto$1(classProto);
1088
+ var visited = [];
1089
+ while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
1090
+ _forEachProp(baseProto, function (name) {
1091
+ if (!baseFuncSources[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
1092
+ baseFuncSources[name] = baseProto;
1093
+ }
1094
+ });
1095
+ visited.push(baseProto);
1096
+ baseProto = _getObjProto$1(baseProto);
1097
+ }
1098
+ classProto[DynBaseProtoFuncs] = baseFuncSources;
1099
+ return baseFuncSources;
1100
+ }
1066
1101
  function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
1067
1102
  function _instFuncProxy(target, funcHost, funcName) {
1068
1103
  var theFunc = funcHost[funcName];
@@ -1080,16 +1115,11 @@ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
1080
1115
  _forEachProp(instFuncs, function (name) {
1081
1116
  baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
1082
1117
  });
1083
- var baseProto = _getObjProto$1(classProto);
1084
- var visited = [];
1085
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
1086
- _forEachProp(baseProto, function (name) {
1087
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
1088
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
1089
- }
1090
- });
1091
- visited.push(baseProto);
1092
- baseProto = _getObjProto$1(baseProto);
1118
+ var baseFuncSources = _getBaseProtoFuncs(classProto);
1119
+ for (var name_2 in baseFuncSources) {
1120
+ if (!baseFuncs[name_2]) {
1121
+ baseFuncs[name_2] = _instFuncProxy(thisTarget, baseFuncSources[name_2], name_2);
1122
+ }
1093
1123
  }
1094
1124
  return baseFuncs;
1095
1125
  }
@@ -1103,16 +1133,18 @@ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
1103
1133
  }
1104
1134
  if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
1105
1135
  var canAddInst = !objHasOwnProperty(target, funcName);
1106
- var objProto = _getObjProto$1(target);
1107
- var visited = [];
1108
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
1109
- var protoFunc = objProto[funcName];
1110
- if (protoFunc) {
1111
- canAddInst = (protoFunc === currentDynProtoProxy);
1112
- break;
1136
+ if (canAddInst) {
1137
+ var objProto = _getObjProto$1(target);
1138
+ var visited = [];
1139
+ while (objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
1140
+ var protoFunc = objProto[funcName];
1141
+ if (protoFunc) {
1142
+ canAddInst = (protoFunc === currentDynProtoProxy);
1143
+ break;
1144
+ }
1145
+ visited.push(objProto);
1146
+ objProto = _getObjProto$1(objProto);
1113
1147
  }
1114
- visited.push(objProto);
1115
- objProto = _getObjProto$1(objProto);
1116
1148
  }
1117
1149
  try {
1118
1150
  if (canAddInst) {
@@ -1139,25 +1171,34 @@ function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
1139
1171
  }
1140
1172
  function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
1141
1173
  function _createDynamicPrototype(proto, funcName) {
1174
+ var cacheKey = DynResolvedCachePrefix + className + "." + funcName;
1142
1175
  var dynProtoProxy = function () {
1143
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
1176
+ var instFuncTable = this[DynInstFuncTable];
1177
+ var instFunc = instFuncTable ? instFuncTable[cacheKey] : undefined;
1178
+ if (!instFunc) {
1179
+ instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
1180
+ if (instFuncTable) {
1181
+ instFuncTable[cacheKey] = instFunc;
1182
+ }
1183
+ }
1144
1184
  return instFunc.apply(this, arguments);
1145
1185
  };
1146
1186
  dynProtoProxy[DynProxyTag] = 1;
1147
1187
  return dynProtoProxy;
1148
1188
  }
1149
1189
  if (!_isObjectOrArrayPrototype(proto)) {
1150
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);
1151
- if (!_isObjectOrArrayPrototype(instFuncTable)) {
1152
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || objCreate(null));
1153
- if (instFuncTable[DynAllowInstChkTag] !== false) {
1154
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
1190
+ var instFuncTable_1 = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);
1191
+ if (!_isObjectOrArrayPrototype(instFuncTable_1)) {
1192
+ var instFuncs_1 = instFuncTable_1[className] = (instFuncTable_1[className] || objCreate(null));
1193
+ if (instFuncTable_1[DynAllowInstChkTag] !== false) {
1194
+ instFuncTable_1[DynAllowInstChkTag] = !!setInstanceFunc;
1155
1195
  }
1156
1196
  if (!_isObjectOrArrayPrototype(instFuncs_1)) {
1157
1197
  _forEachProp(target, function (name) {
1158
1198
  if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
1159
1199
  instFuncs_1[name] = target[name];
1160
1200
  delete target[name];
1201
+ delete instFuncTable_1[DynResolvedCachePrefix + className + "." + name];
1161
1202
  if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
1162
1203
  proto[name] = _createDynamicPrototype(proto, name);
1163
1204
  }
@@ -1710,7 +1751,7 @@ function newId(maxLength) {
1710
1751
  return result;
1711
1752
  }
1712
1753
 
1713
- var version = '3.4.2-nightly3.2605-06';
1754
+ var version = "3.4.2-nightly3.2605-11";
1714
1755
  var instanceName = "." + newId(6);
1715
1756
  var _dataUid = 0;
1716
1757
  function _canAcceptData(target) {