@microsoft/applicationinsights-react-native 4.4.1-nightly.2605-03 → 4.4.1-nightly.2606-01
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/browser/applicationinsights-react-native.js +523 -194
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +2 -2
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.api.json +1 -1
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +523 -194
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +2 -2
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/DeviceInfo/DeviceModule.js +1 -1
- package/dist-esm/DeviceInfo/ReactNativeDeviceInfo.js +1 -1
- package/dist-esm/Interfaces/IDeviceInfoModule.js +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativeManualDevicePlugin.js +1 -1
- package/dist-esm/ReactNativePlugin.js +1 -1
- package/dist-esm/index.js +1 -1
- package/dist-esm/manualIndex.js +1 -1
- package/package.json +3 -3
- package/tsconfig.json +1 -0
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 4.4.1-nightly.
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 4.4.1-nightly.2606-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
var strShimPrototype = "prototype";
|
|
19
19
|
var ObjClass$1 = Object;
|
|
20
20
|
|
|
21
|
-
/*! https://github.com/nevware21/ts-utils v0.
|
|
21
|
+
/*! https://github.com/nevware21/ts-utils v0.15.0 */
|
|
22
22
|
function _pureAssign(func1, func2) {
|
|
23
23
|
return func1 || func2;
|
|
24
24
|
}
|
|
25
25
|
function _pureRef(value, name) {
|
|
26
|
-
return value[name];
|
|
26
|
+
return value !== null && value !== undefined ? value[name] : undefined;
|
|
27
27
|
}
|
|
28
28
|
var UNDEF_VALUE = undefined;
|
|
29
29
|
var NULL_VALUE = null;
|
|
@@ -42,15 +42,26 @@
|
|
|
42
42
|
var GET_OWN_PROPERTY_DESCRIPTOR = "getOwnPropertyDescriptor";
|
|
43
43
|
var GET_OWN_PROPERTY_NAMES = "getOwnPropertyNames";
|
|
44
44
|
var GET_OWN_PROPERTY_SYMBOLS = "getOwnPropertySymbols";
|
|
45
|
-
var ObjClass = (
|
|
46
|
-
var ObjProto = (
|
|
47
|
-
var StrCls = (
|
|
48
|
-
var StrProto = (
|
|
49
|
-
var MathCls = (
|
|
50
|
-
var ArrCls = (
|
|
51
|
-
var ArrProto = (
|
|
52
|
-
var ArrSlice = (
|
|
53
|
-
var NumberCls = (
|
|
45
|
+
var ObjClass = (_pureAssign(Object));
|
|
46
|
+
var ObjProto = (_pureRef(ObjClass, PROTOTYPE));
|
|
47
|
+
var StrCls = (_pureAssign(String));
|
|
48
|
+
var StrProto = (_pureRef(StrCls, PROTOTYPE));
|
|
49
|
+
var MathCls = (_pureAssign(Math));
|
|
50
|
+
var ArrCls = (_pureAssign(Array));
|
|
51
|
+
var ArrProto = (_pureRef(ArrCls, PROTOTYPE));
|
|
52
|
+
var ArrSlice = (_pureRef(ArrProto, "slice"));
|
|
53
|
+
var NumberCls = (_pureAssign(Number));
|
|
54
|
+
(_pureRef(NumberCls, PROTOTYPE));
|
|
55
|
+
var FuncCls = (_pureAssign(Function));
|
|
56
|
+
(_pureRef(FuncCls, PROTOTYPE));
|
|
57
|
+
var DateCls = (_pureAssign(Date));
|
|
58
|
+
(_pureRef(DateCls, PROTOTYPE));
|
|
59
|
+
var RegExpCls = (_pureAssign(RegExp));
|
|
60
|
+
(_pureRef(RegExpCls, PROTOTYPE));
|
|
61
|
+
var BooleanCls = (_pureAssign(Boolean));
|
|
62
|
+
(_pureRef(BooleanCls, PROTOTYPE));
|
|
63
|
+
var ErrorCls = (_pureAssign(Error));
|
|
64
|
+
(_pureRef(ErrorCls, PROTOTYPE));
|
|
54
65
|
var POLYFILL_TAG = "_polyfill";
|
|
55
66
|
var POLYFILL_TYPE_NAME = "__nw21$polytype__";
|
|
56
67
|
function safe(func, argArray) {
|
|
@@ -92,18 +103,21 @@
|
|
|
92
103
|
function isDefined(arg) {
|
|
93
104
|
return !!arg || arg !== UNDEF_VALUE;
|
|
94
105
|
}
|
|
95
|
-
var isString = (
|
|
96
|
-
var isFunction = (
|
|
106
|
+
var isString = (_createIs("string"));
|
|
107
|
+
var isFunction = (_createIs(FUNCTION));
|
|
97
108
|
function isObject(value) {
|
|
98
109
|
if (!value && isNullOrUndefined(value)) {
|
|
99
110
|
return false;
|
|
100
111
|
}
|
|
101
112
|
return !!value && typeof value === OBJECT;
|
|
102
113
|
}
|
|
103
|
-
var isArray = (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
var isArray = (_pureRef(ArrCls, "isArray"));
|
|
115
|
+
function isArrayLike(arg) {
|
|
116
|
+
return !isStrictNullOrUndefined(arg) && !isFunction(arg) && isNumber(arg[LENGTH]) && arg[LENGTH] >= 0;
|
|
117
|
+
}
|
|
118
|
+
var isNumber = (_createIs("number"));
|
|
119
|
+
var isRegExp = (_createObjIs("RegExp"));
|
|
120
|
+
var isError = (_createObjIs("Error"));
|
|
107
121
|
function isPromiseLike(value) {
|
|
108
122
|
return !!(value && value.then && isFunction(value.then));
|
|
109
123
|
}
|
|
@@ -116,7 +130,7 @@
|
|
|
116
130
|
function _returnFalse() {
|
|
117
131
|
return false;
|
|
118
132
|
}
|
|
119
|
-
var asString = (
|
|
133
|
+
var asString = (_pureAssign(StrCls));
|
|
120
134
|
var ERROR_TYPE = "[object Error]";
|
|
121
135
|
function dumpObj(object, format) {
|
|
122
136
|
var propertyValueDump = EMPTY;
|
|
@@ -152,8 +166,8 @@
|
|
|
152
166
|
function objHasOwnProperty(obj, prop) {
|
|
153
167
|
return !!obj && ObjProto.hasOwnProperty[CALL](obj, prop);
|
|
154
168
|
}
|
|
155
|
-
var _objGetOwnPropertyDescriptor$2 = (
|
|
156
|
-
var objHasOwn = (
|
|
169
|
+
var _objGetOwnPropertyDescriptor$2 = (_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
170
|
+
var objHasOwn = (_pureAssign((_pureRef(ObjClass, "hasOwn")), polyObjHasOwn));
|
|
157
171
|
function polyObjHasOwn(obj, prop) {
|
|
158
172
|
_throwIfNullOrUndefined(obj);
|
|
159
173
|
return objHasOwnProperty(obj, prop) || !!_objGetOwnPropertyDescriptor$2(obj, prop);
|
|
@@ -162,7 +176,7 @@
|
|
|
162
176
|
if (theObject && (isObject(theObject) || isFunction(theObject))) {
|
|
163
177
|
for (var prop in theObject) {
|
|
164
178
|
if (objHasOwn(theObject, prop)) {
|
|
165
|
-
if (callbackfn[CALL](thisArg
|
|
179
|
+
if (callbackfn[CALL](isStrictNullOrUndefined(thisArg) ? theObject : thisArg, prop, theObject[prop]) === -1) {
|
|
166
180
|
break;
|
|
167
181
|
}
|
|
168
182
|
}
|
|
@@ -174,14 +188,14 @@
|
|
|
174
188
|
var len = theArray[LENGTH] >>> 0;
|
|
175
189
|
for (var idx = 0; idx < len; idx++) {
|
|
176
190
|
if (idx in theArray) {
|
|
177
|
-
if (callbackfn[CALL](thisArg
|
|
191
|
+
if (callbackfn[CALL](isStrictNullOrUndefined(thisArg) ? theArray : thisArg, theArray[idx], idx, theArray) === -1) {
|
|
178
192
|
break;
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
}
|
|
182
196
|
}
|
|
183
197
|
}
|
|
184
|
-
var _unwrapFunction =
|
|
198
|
+
var _unwrapFunction = _unwrapFunctionWithPoly;
|
|
185
199
|
function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
|
|
186
200
|
var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
|
|
187
201
|
return function (thisArg) {
|
|
@@ -193,26 +207,43 @@
|
|
|
193
207
|
throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
|
|
194
208
|
};
|
|
195
209
|
}
|
|
210
|
+
function _unwrapFunctionNoInstWithPoly(funcName, clsProto, polyFunc) {
|
|
211
|
+
var clsFn = clsProto ? clsProto[funcName] : NULL_VALUE;
|
|
212
|
+
return function (thisArg) {
|
|
213
|
+
var theFunc = clsFn;
|
|
214
|
+
if (theFunc || polyFunc) {
|
|
215
|
+
var theArgs = arguments;
|
|
216
|
+
return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
|
|
217
|
+
}
|
|
218
|
+
throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function _unwrapProp(propName) {
|
|
222
|
+
return function (thisArg) {
|
|
223
|
+
return thisArg[propName];
|
|
224
|
+
};
|
|
225
|
+
}
|
|
196
226
|
function _objPropertyIsEnum(obj, propKey) {
|
|
197
227
|
var desc;
|
|
198
228
|
var fn = ObjClass.getOwnPropertyDescriptor;
|
|
199
229
|
if (!isStrictNullOrUndefined(obj) && fn) {
|
|
200
230
|
desc = safe(fn, [obj, propKey]).v || NULL_VALUE;
|
|
201
231
|
}
|
|
202
|
-
if (!desc) {
|
|
232
|
+
if (!desc && !isStrictNullOrUndefined(obj)) {
|
|
203
233
|
desc = safe(function () {
|
|
204
234
|
for (var key in obj) {
|
|
205
|
-
if (key
|
|
206
|
-
return { enumerable:
|
|
235
|
+
if (key == propKey) {
|
|
236
|
+
return { enumerable: objHasOwnProperty(obj, key) };
|
|
207
237
|
}
|
|
208
238
|
}
|
|
209
239
|
}).v;
|
|
210
240
|
}
|
|
211
241
|
return (desc && desc.enumerable) || false;
|
|
212
242
|
}
|
|
213
|
-
(
|
|
214
|
-
|
|
215
|
-
(
|
|
243
|
+
(_unwrapFunctionWithPoly("propertyIsEnumerable", NULL_VALUE, _objPropertyIsEnum));
|
|
244
|
+
(_unwrapFunctionNoInstWithPoly("propertyIsEnumerable", ObjProto, _objPropertyIsEnum));
|
|
245
|
+
var _objGetOwnPropertyDescriptor$1 = (_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
246
|
+
(_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_SYMBOLS)), _returnEmptyArray));
|
|
216
247
|
var propMap = {
|
|
217
248
|
e: "enumerable",
|
|
218
249
|
c: "configurable",
|
|
@@ -239,8 +270,8 @@
|
|
|
239
270
|
});
|
|
240
271
|
return prop;
|
|
241
272
|
}
|
|
242
|
-
var objDefineProp = (
|
|
243
|
-
var objDefineProperties = (
|
|
273
|
+
var objDefineProp = (_pureRef(ObjClass, "defineProperty"));
|
|
274
|
+
var objDefineProperties = (_pureRef(ObjClass, "defineProperties"));
|
|
244
275
|
function objDefine(target, key, propDesc) {
|
|
245
276
|
return objDefineProp(target, key, _createProp(propDesc));
|
|
246
277
|
}
|
|
@@ -281,9 +312,9 @@
|
|
|
281
312
|
}
|
|
282
313
|
return value1 === value2;
|
|
283
314
|
}
|
|
284
|
-
var objIsFrozen = (
|
|
285
|
-
(
|
|
286
|
-
var _objFreeze = (
|
|
315
|
+
var objIsFrozen = (_pureAssign((_pureRef(ObjClass, "isFrozen")), _returnFalse));
|
|
316
|
+
(_pureAssign((_pureRef(ObjClass, "isSealed")), _returnFalse));
|
|
317
|
+
var _objFreeze = (_pureRef(ObjClass, "freeze"));
|
|
287
318
|
function _doNothing(value) {
|
|
288
319
|
return value;
|
|
289
320
|
}
|
|
@@ -291,8 +322,8 @@
|
|
|
291
322
|
_throwIfNullOrUndefined(value);
|
|
292
323
|
return value[__PROTO__] || NULL_VALUE;
|
|
293
324
|
}
|
|
294
|
-
(
|
|
295
|
-
var objKeys = (
|
|
325
|
+
(_pureRef(ObjClass, "assign"));
|
|
326
|
+
var objKeys = (_pureRef(ObjClass, "keys"));
|
|
296
327
|
function _deepFreeze(val, visited) {
|
|
297
328
|
if ((isArray(val) || isObject(val) || isFunction(val)) && !objIsFrozen(val)) {
|
|
298
329
|
for (var lp = 0; lp < visited.length; lp++) {
|
|
@@ -311,16 +342,16 @@
|
|
|
311
342
|
function objDeepFreeze(value) {
|
|
312
343
|
return _objFreeze ? _deepFreeze(value, []) : value;
|
|
313
344
|
}
|
|
314
|
-
var objFreeze = (
|
|
315
|
-
(
|
|
316
|
-
var objGetPrototypeOf = (
|
|
317
|
-
(
|
|
318
|
-
(
|
|
319
|
-
(
|
|
345
|
+
var objFreeze = (_pureAssign(_objFreeze, _doNothing));
|
|
346
|
+
(_pureAssign((_pureRef(ObjClass, "seal")), _doNothing));
|
|
347
|
+
var objGetPrototypeOf = (_pureAssign((_pureRef(ObjClass, "getPrototypeOf")), _getProto));
|
|
348
|
+
(_pureAssign((_pureRef(ObjClass, "entries")), polyObjEntries));
|
|
349
|
+
(_pureAssign((_pureRef(ObjClass, "values")), polyObjValues));
|
|
350
|
+
(_pureAssign((_pureRef(ObjClass, "is")), polyObjIs));
|
|
320
351
|
function createEnumKeyMap(values) {
|
|
321
352
|
return _createKeyValueMap(values, 0 , 0 , objFreeze);
|
|
322
353
|
}
|
|
323
|
-
var _wellKnownSymbolMap = (
|
|
354
|
+
var _wellKnownSymbolMap = (createEnumKeyMap({
|
|
324
355
|
asyncIterator: 0 ,
|
|
325
356
|
hasInstance: 1 ,
|
|
326
357
|
isConcatSpreadable: 2 ,
|
|
@@ -360,11 +391,11 @@
|
|
|
360
391
|
}
|
|
361
392
|
return _globalCfg;
|
|
362
393
|
}
|
|
363
|
-
(
|
|
364
|
-
var mathMax = (
|
|
365
|
-
var strSlice = (
|
|
366
|
-
var strSubstring = (
|
|
367
|
-
(
|
|
394
|
+
var mathMin = (_pureRef(MathCls, "min"));
|
|
395
|
+
var mathMax = (_pureRef(MathCls, "max"));
|
|
396
|
+
var strSlice = (_unwrapFunction("slice", StrProto));
|
|
397
|
+
var strSubstring = (_unwrapFunction("substring", StrProto));
|
|
398
|
+
(_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
|
|
368
399
|
function polyStrSubstr(value, start, length) {
|
|
369
400
|
_throwIfNullOrUndefined(value);
|
|
370
401
|
if (length < 0) {
|
|
@@ -398,7 +429,7 @@
|
|
|
398
429
|
}
|
|
399
430
|
return target;
|
|
400
431
|
}
|
|
401
|
-
var objCreate = (
|
|
432
|
+
var objCreate = (_pureAssign((_pureRef(ObjClass, "create")), polyObjCreate));
|
|
402
433
|
function polyObjCreate(obj, properties) {
|
|
403
434
|
var newObj = null;
|
|
404
435
|
function tempFunc() { }
|
|
@@ -430,6 +461,9 @@
|
|
|
430
461
|
function fnApply(fn, thisArg, argArray) {
|
|
431
462
|
return fn.apply(thisArg, argArray);
|
|
432
463
|
}
|
|
464
|
+
function fnCall(fn, thisArg) {
|
|
465
|
+
return fn.apply(thisArg, ArrSlice[CALL](arguments, 2));
|
|
466
|
+
}
|
|
433
467
|
var _globalLazyTestHooks;
|
|
434
468
|
function _initTestHooks() {
|
|
435
469
|
_globalLazyTestHooks = _getGlobalConfig();
|
|
@@ -453,8 +487,8 @@
|
|
|
453
487
|
});
|
|
454
488
|
return lazyValue;
|
|
455
489
|
}
|
|
456
|
-
var mathRandom = (
|
|
457
|
-
var _uniqueInstanceId = (
|
|
490
|
+
var mathRandom = (_pureRef(MathCls, "random"));
|
|
491
|
+
var _uniqueInstanceId = (getLazy(function () {
|
|
458
492
|
var value = (utcNow().toString(36).slice(2));
|
|
459
493
|
while (value.length < 16) {
|
|
460
494
|
value += mathRandom().toString(36).slice(2);
|
|
@@ -557,14 +591,14 @@
|
|
|
557
591
|
return NULL_VALUE;
|
|
558
592
|
}
|
|
559
593
|
function hasWindow() {
|
|
560
|
-
return !!
|
|
594
|
+
return !!getWindow();
|
|
561
595
|
}
|
|
562
|
-
var getWindow = (
|
|
563
|
-
var getNavigator = (
|
|
596
|
+
var getWindow = (_getGlobalInstFn(getInst, [WINDOW]));
|
|
597
|
+
var getNavigator = (_getGlobalInstFn(getInst, ["navigator"]));
|
|
564
598
|
var _symbol;
|
|
565
599
|
var _symbolFor;
|
|
566
600
|
function _initSymbol() {
|
|
567
|
-
_symbol = (
|
|
601
|
+
_symbol = (createCachedValue(safe((getInst), [SYMBOL]).v));
|
|
568
602
|
return _symbol;
|
|
569
603
|
}
|
|
570
604
|
function _getSymbolKey(key) {
|
|
@@ -584,7 +618,7 @@
|
|
|
584
618
|
}
|
|
585
619
|
function symbolFor(key) {
|
|
586
620
|
!_globalLazyTestHooks && _initTestHooks();
|
|
587
|
-
_symbolFor = ((!_globalLazyTestHooks.lzy ? _symbolFor : 0) || (
|
|
621
|
+
_symbolFor = ((!_globalLazyTestHooks.lzy ? _symbolFor : 0) || (createCachedValue(safe((_getSymbolKey), ["for"]).v)));
|
|
588
622
|
return (_symbolFor.v || polySymbolFor)(key);
|
|
589
623
|
}
|
|
590
624
|
function isIterator(value) {
|
|
@@ -606,7 +640,7 @@
|
|
|
606
640
|
try {
|
|
607
641
|
var count = 0;
|
|
608
642
|
while (!(iterResult = iter.next()).done) {
|
|
609
|
-
if (callbackfn[CALL](thisArg
|
|
643
|
+
if (callbackfn[CALL](isStrictNullOrUndefined(thisArg) ? iter : thisArg, iterResult.value, count, iter) === -1) {
|
|
610
644
|
break;
|
|
611
645
|
}
|
|
612
646
|
count++;
|
|
@@ -650,11 +684,25 @@
|
|
|
650
684
|
}
|
|
651
685
|
return target;
|
|
652
686
|
}
|
|
653
|
-
_unwrapFunction("
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
687
|
+
(_unwrapFunction("concat", ArrProto));
|
|
688
|
+
_unwrapFunctionWithPoly("at", ArrProto, polyArrAt);
|
|
689
|
+
function polyArrAt(theArray, index) {
|
|
690
|
+
var result;
|
|
691
|
+
if (isArrayLike(theArray)) {
|
|
692
|
+
var len = theArray.length;
|
|
693
|
+
var idx = index;
|
|
694
|
+
if (idx < 0) {
|
|
695
|
+
idx = len + idx;
|
|
696
|
+
}
|
|
697
|
+
if (idx >= 0 && idx < len) {
|
|
698
|
+
result = theArray[idx];
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return result;
|
|
702
|
+
}
|
|
703
|
+
var arrIndexOf = (_unwrapFunction("indexOf", ArrProto));
|
|
704
|
+
(_unwrapFunction("lastIndexOf", ArrProto));
|
|
705
|
+
var arrMap = (_unwrapFunction("map", ArrProto));
|
|
658
706
|
function arrSlice(theArray, start, end) {
|
|
659
707
|
return ((theArray ? theArray["slice"] : NULL_VALUE) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));
|
|
660
708
|
}
|
|
@@ -669,7 +717,7 @@
|
|
|
669
717
|
function polyArrFindIndex(theArray, callbackFn, thisArg) {
|
|
670
718
|
var result = -1;
|
|
671
719
|
arrForEach(theArray, function (value, index) {
|
|
672
|
-
if (callbackFn[CALL](thisArg
|
|
720
|
+
if (callbackFn[CALL](isStrictNullOrUndefined(thisArg) ? theArray : thisArg, value, index, theArray)) {
|
|
673
721
|
result = index;
|
|
674
722
|
return -1;
|
|
675
723
|
}
|
|
@@ -685,7 +733,7 @@
|
|
|
685
733
|
var result = -1;
|
|
686
734
|
var len = theArray[LENGTH] >>> 0;
|
|
687
735
|
for (var idx = len - 1; idx >= 0; idx--) {
|
|
688
|
-
if (idx in theArray && callbackFn[CALL](thisArg
|
|
736
|
+
if (idx in theArray && callbackFn[CALL](isStrictNullOrUndefined(thisArg) ? theArray : thisArg, theArray[idx], idx, theArray)) {
|
|
689
737
|
result = idx;
|
|
690
738
|
break;
|
|
691
739
|
}
|
|
@@ -703,16 +751,167 @@
|
|
|
703
751
|
});
|
|
704
752
|
return result;
|
|
705
753
|
}
|
|
754
|
+
(_unwrapFunctionWithPoly("includes", ArrProto, polyArrIncludes));
|
|
755
|
+
_unwrapFunction("every", ArrProto);
|
|
756
|
+
_unwrapFunction("filter", ArrProto);
|
|
757
|
+
var getLength = (_unwrapProp(LENGTH));
|
|
758
|
+
_unwrapFunctionWithPoly("fill", ArrProto, polyArrFill);
|
|
759
|
+
function polyArrFill(theArray, value, start, end) {
|
|
760
|
+
if (isArrayLike(theArray)) {
|
|
761
|
+
var len = getLength(theArray);
|
|
762
|
+
var startIdx = start === UNDEF_VALUE ? 0 : start;
|
|
763
|
+
var endIdx = end === UNDEF_VALUE ? len : end;
|
|
764
|
+
if (startIdx < 0) {
|
|
765
|
+
startIdx = mathMax(len + startIdx, 0);
|
|
766
|
+
}
|
|
767
|
+
else {
|
|
768
|
+
startIdx = mathMin(startIdx, len);
|
|
769
|
+
}
|
|
770
|
+
if (endIdx < 0) {
|
|
771
|
+
endIdx = mathMax(len + endIdx, 0);
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
endIdx = mathMin(endIdx, len);
|
|
775
|
+
}
|
|
776
|
+
for (var i = startIdx; i < endIdx; i++) {
|
|
777
|
+
theArray[i] = value;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return theArray;
|
|
781
|
+
}
|
|
706
782
|
_unwrapFunctionWithPoly("find", ArrProto, polyArrFind);
|
|
707
783
|
_unwrapFunctionWithPoly("findIndex", ArrProto, polyArrFindIndex);
|
|
708
784
|
_unwrapFunctionWithPoly("findLast", ArrProto, polyArrFindLast);
|
|
709
785
|
_unwrapFunctionWithPoly("findLastIndex", ArrProto, polyArrFindLastIndex);
|
|
710
|
-
(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
786
|
+
_unwrapFunctionWithPoly("flatMap", ArrProto, polyArrFlatMap);
|
|
787
|
+
function polyArrFlatMap(theArray, callbackFn, thisArg) {
|
|
788
|
+
_throwIfNullOrUndefined(theArray);
|
|
789
|
+
if (!isFunction(callbackFn)) {
|
|
790
|
+
throwTypeError("callbackFn must be a function");
|
|
791
|
+
}
|
|
792
|
+
var result = [];
|
|
793
|
+
var callbackThis = arguments.length > 2 ? thisArg : undefined;
|
|
794
|
+
arrForEach(theArray, function (theValue, index) {
|
|
795
|
+
var value = fnCall(callbackFn, callbackThis, theValue, index, theArray);
|
|
796
|
+
if (isArray(value)) {
|
|
797
|
+
arrForEach(value, function (mappedValue) {
|
|
798
|
+
result.push(mappedValue);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
result.push(value);
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
return result;
|
|
806
|
+
}
|
|
807
|
+
(_pureAssign((_pureRef(ArrCls, "from")), polyArrFrom));
|
|
808
|
+
var mathFloor = (_pureRef(MathCls, "floor"));
|
|
809
|
+
var mathCeil = (_pureRef(MathCls, "ceil"));
|
|
810
|
+
var mathTrunc = (_pureAssign((_pureRef(MathCls, "trunc")), polyMathTrunc));
|
|
811
|
+
function polyMathTrunc(value) {
|
|
812
|
+
var theValue = +value;
|
|
813
|
+
return (theValue > 0 ? mathFloor : mathCeil)(theValue);
|
|
814
|
+
}
|
|
815
|
+
function mathToInt(value, throwInfinity) {
|
|
816
|
+
var result = +value;
|
|
817
|
+
if (throwInfinity && (result === Infinity || result == Infinity)) {
|
|
818
|
+
throwRangeError("invalid value [" + dumpObj(value) + "]");
|
|
819
|
+
}
|
|
820
|
+
return result !== result || result === 0 ? 0 : mathTrunc(result);
|
|
821
|
+
}
|
|
822
|
+
function createIterableIterator(ctx) {
|
|
823
|
+
var iterator = createIterator(ctx);
|
|
824
|
+
var itSymbol = getKnownSymbol(3 );
|
|
825
|
+
function _createIterator() {
|
|
826
|
+
return iterator;
|
|
827
|
+
}
|
|
828
|
+
iterator[itSymbol] = _createIterator;
|
|
829
|
+
return iterator;
|
|
830
|
+
}
|
|
831
|
+
function createIterator(ctx) {
|
|
832
|
+
var isDone = false;
|
|
833
|
+
function _value() {
|
|
834
|
+
return ctx.v;
|
|
835
|
+
}
|
|
836
|
+
function _next() {
|
|
837
|
+
if (!isDone) {
|
|
838
|
+
isDone = (ctx.n ? ctx.n(arguments) : true);
|
|
839
|
+
}
|
|
840
|
+
var result = {
|
|
841
|
+
done: isDone
|
|
842
|
+
};
|
|
843
|
+
if (!isDone) {
|
|
844
|
+
objDefine(result, "value", { g: _value });
|
|
845
|
+
}
|
|
846
|
+
return result;
|
|
847
|
+
}
|
|
848
|
+
function _return(value) {
|
|
849
|
+
isDone = true;
|
|
850
|
+
return {
|
|
851
|
+
done: true,
|
|
852
|
+
value: ctx.r && ctx.r(value)
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function _throw(e) {
|
|
856
|
+
isDone = true;
|
|
857
|
+
return {
|
|
858
|
+
done: true,
|
|
859
|
+
value: ctx.t && ctx.t(e)
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
var theIterator = {
|
|
863
|
+
next: _next
|
|
864
|
+
};
|
|
865
|
+
if (ctx.r) {
|
|
866
|
+
theIterator.return = _return;
|
|
867
|
+
}
|
|
868
|
+
if (ctx.t) {
|
|
869
|
+
theIterator.throw = _throw;
|
|
870
|
+
}
|
|
871
|
+
return theIterator;
|
|
872
|
+
}
|
|
873
|
+
_unwrapFunctionWithPoly("keys", ArrProto, polyArrKeys);
|
|
874
|
+
function polyArrKeys(value) {
|
|
875
|
+
_throwIfNullOrUndefined(value);
|
|
876
|
+
var idx = -1;
|
|
877
|
+
var len = mathToInt(value.length);
|
|
878
|
+
if (len < 0) {
|
|
879
|
+
len = 0;
|
|
880
|
+
}
|
|
881
|
+
return createIterableIterator({
|
|
882
|
+
n: function () {
|
|
883
|
+
idx++;
|
|
884
|
+
var isDone = idx >= len;
|
|
885
|
+
if (!isDone) {
|
|
886
|
+
this.v = idx;
|
|
887
|
+
}
|
|
888
|
+
return isDone;
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
(_unwrapFunction("reduce", ArrProto));
|
|
893
|
+
(_unwrapFunction("reverse", ArrProto));
|
|
894
|
+
(_unwrapFunction("some", ArrProto));
|
|
895
|
+
_unwrapFunctionWithPoly("with", ArrProto, polyArrWith);
|
|
896
|
+
function polyArrWith(theArray, index, value) {
|
|
897
|
+
var result;
|
|
898
|
+
if (!isArrayLike(theArray)) {
|
|
899
|
+
throwRangeError("Invalid array");
|
|
900
|
+
}
|
|
901
|
+
var len = getLength(theArray);
|
|
902
|
+
var idx = index;
|
|
903
|
+
if (idx < 0) {
|
|
904
|
+
idx = len + idx;
|
|
905
|
+
}
|
|
906
|
+
if (idx < 0 || idx >= len) {
|
|
907
|
+
throwRangeError("Index out of bounds");
|
|
908
|
+
}
|
|
909
|
+
result = arrSlice(theArray);
|
|
910
|
+
result[idx] = value;
|
|
911
|
+
return result;
|
|
912
|
+
}
|
|
714
913
|
var _isProtoArray;
|
|
715
|
-
var objSetPrototypeOf = (
|
|
914
|
+
var objSetPrototypeOf = (_pureAssign((_pureRef(ObjClass, "setPrototypeOf")), _polyObjSetPrototypeOf));
|
|
716
915
|
function _polyObjSetPrototypeOf(obj, proto) {
|
|
717
916
|
var _a;
|
|
718
917
|
!_isProtoArray && (_isProtoArray = createCachedValue((_a = {}, _a[__PROTO__] = [], _a) instanceof Array));
|
|
@@ -757,38 +956,26 @@
|
|
|
757
956
|
}
|
|
758
957
|
}, theBaseClass);
|
|
759
958
|
}
|
|
959
|
+
var strReplace = (_unwrapFunction("replace", StrProto));
|
|
760
960
|
function _createTrimFn(exp) {
|
|
761
961
|
return function _doTrim(value) {
|
|
762
962
|
_throwIfNullOrUndefined(value);
|
|
763
|
-
|
|
764
|
-
|
|
963
|
+
value = asString(value);
|
|
964
|
+
if (value) {
|
|
965
|
+
value = strReplace(value, exp, EMPTY);
|
|
765
966
|
}
|
|
766
967
|
return value;
|
|
767
968
|
};
|
|
768
969
|
}
|
|
769
|
-
var polyStrTrim = (
|
|
770
|
-
var polyStrTrimStart = (
|
|
771
|
-
var polyStrTrimEnd = (
|
|
772
|
-
(
|
|
773
|
-
(
|
|
774
|
-
(
|
|
775
|
-
(
|
|
776
|
-
(
|
|
777
|
-
var
|
|
778
|
-
var mathCeil = ( _pureRef(MathCls, "ceil"));
|
|
779
|
-
var mathTrunc = ( _pureAssign(( _pureRef(MathCls, "trunc")), polyMathTrunc));
|
|
780
|
-
function polyMathTrunc(value) {
|
|
781
|
-
var theValue = +value;
|
|
782
|
-
return (theValue > 0 ? mathFloor : mathCeil)(theValue);
|
|
783
|
-
}
|
|
784
|
-
function mathToInt(value, throwInfinity) {
|
|
785
|
-
var result = +value;
|
|
786
|
-
if (throwInfinity && (result === Infinity || result == Infinity)) {
|
|
787
|
-
throwRangeError("invalid value [" + dumpObj(value) + "]");
|
|
788
|
-
}
|
|
789
|
-
return result !== result || result === 0 ? 0 : mathTrunc(result);
|
|
790
|
-
}
|
|
791
|
-
var strRepeat = ( _unwrapFunctionWithPoly("repeat", StrProto, polyStrRepeat));
|
|
970
|
+
var polyStrTrim = (_createTrimFn(/^\s+|(?=\s)\s+$/g));
|
|
971
|
+
var polyStrTrimStart = (_createTrimFn(/^\s+/g));
|
|
972
|
+
var polyStrTrimEnd = (_createTrimFn(/(?=\s)\s+$/g));
|
|
973
|
+
(_unwrapFunctionWithPoly("trim", StrProto, polyStrTrim));
|
|
974
|
+
(_unwrapFunctionWithPoly("trimStart", StrProto, polyStrTrimStart));
|
|
975
|
+
(_unwrapFunctionWithPoly("trimEnd", StrProto, polyStrTrimEnd));
|
|
976
|
+
(_unwrapFunction("toUpperCase", StrProto));
|
|
977
|
+
(_unwrapFunction("toLowerCase", StrProto));
|
|
978
|
+
var strRepeat = (_unwrapFunctionWithPoly("repeat", StrProto, polyStrRepeat));
|
|
792
979
|
function polyStrRepeat(value, count) {
|
|
793
980
|
_throwIfNullOrUndefined(value);
|
|
794
981
|
count = mathToInt(count, true);
|
|
@@ -821,74 +1008,18 @@
|
|
|
821
1008
|
}
|
|
822
1009
|
return result;
|
|
823
1010
|
}
|
|
824
|
-
(
|
|
825
|
-
(
|
|
1011
|
+
(_unwrapFunctionWithPoly("padStart", StrProto, polyStrPadStart));
|
|
1012
|
+
(_unwrapFunctionWithPoly("padEnd", StrProto, polyStrPadEnd));
|
|
826
1013
|
function polyStrPadStart(value, targetLength, padString) {
|
|
827
1014
|
return _padValue(value, targetLength, padString) + value;
|
|
828
1015
|
}
|
|
829
1016
|
function polyStrPadEnd(value, targetLength, padString) {
|
|
830
1017
|
return value + _padValue(value, targetLength, padString);
|
|
831
1018
|
}
|
|
832
|
-
var _fnToString;
|
|
833
|
-
var _objCtrFnString;
|
|
834
|
-
var _gblWindow;
|
|
835
|
-
function isPlainObject(value) {
|
|
836
|
-
if (!value || typeof value !== OBJECT) {
|
|
837
|
-
return false;
|
|
838
|
-
}
|
|
839
|
-
if (!_gblWindow) {
|
|
840
|
-
_gblWindow = hasWindow() ? getWindow() : true;
|
|
841
|
-
}
|
|
842
|
-
var result = false;
|
|
843
|
-
if (value !== _gblWindow) {
|
|
844
|
-
if (!_objCtrFnString) {
|
|
845
|
-
_fnToString = Function[PROTOTYPE][TO_STRING];
|
|
846
|
-
_objCtrFnString = _fnToString[CALL](ObjClass);
|
|
847
|
-
}
|
|
848
|
-
try {
|
|
849
|
-
var proto = objGetPrototypeOf(value);
|
|
850
|
-
result = !proto;
|
|
851
|
-
if (!result) {
|
|
852
|
-
if (objHasOwnProperty(proto, CONSTRUCTOR)) {
|
|
853
|
-
proto = proto[CONSTRUCTOR];
|
|
854
|
-
}
|
|
855
|
-
result = !!(proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
catch (ex) {
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
return result;
|
|
862
|
-
}
|
|
863
|
-
function polyStrSymSplit(value, splitter, limit) {
|
|
864
|
-
var splitFn = splitter ? splitter[getKnownSymbol(9 )] : UNDEF_VALUE;
|
|
865
|
-
return splitFn ? splitFn(value, limit) : [value];
|
|
866
|
-
}
|
|
867
|
-
( _unwrapFunction("split", StrProto));
|
|
868
|
-
( _unwrapFunctionWithPoly("split", StrProto, polyStrSymSplit));
|
|
869
|
-
( _pureAssign(( _pureRef(NumberCls, "isInteger")), _polyNumberIsInteger));
|
|
870
|
-
function _polyNumberIsInteger(value) {
|
|
871
|
-
return isNumber(value) && !isNaN(value) &&
|
|
872
|
-
isFinite(value) &&
|
|
873
|
-
mathFloor(value) === value;
|
|
874
|
-
}
|
|
875
|
-
( _pureRef(MathCls, "abs"));
|
|
876
|
-
( _pureRef(MathCls, "exp"));
|
|
877
|
-
( _pureRef(MathCls, "log"));
|
|
878
|
-
( _pureRef(MathCls, "asin"));
|
|
879
|
-
( _pureRef(MathCls, "acos"));
|
|
880
|
-
( _pureRef(MathCls, "atan"));
|
|
881
|
-
( _pureRef(MathCls, "atan2"));
|
|
882
|
-
( _pureRef(MathCls, "pow"));
|
|
883
|
-
( _pureRef(MathCls, "sqrt"));
|
|
884
|
-
( _pureRef(MathCls, "round"));
|
|
885
|
-
( _pureRef(MathCls, "sin"));
|
|
886
|
-
( _pureRef(MathCls, "cos"));
|
|
887
|
-
( _pureRef(MathCls, "tan"));
|
|
888
1019
|
var _recursionCheckOwnDescriptors;
|
|
889
1020
|
var _recursionCheckOwnSymbols;
|
|
890
|
-
var _objGetOwnPropertyNames = (
|
|
891
|
-
var _objGetOwnPropertyDescriptor = (
|
|
1021
|
+
var _objGetOwnPropertyNames = (_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_NAMES)), _returnEmptyArray));
|
|
1022
|
+
var _objGetOwnPropertyDescriptor = (_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
892
1023
|
function polyObjGetOwnPropertyDescriptors(obj) {
|
|
893
1024
|
var result = {};
|
|
894
1025
|
_throwIfNullOrUndefined(obj);
|
|
@@ -935,15 +1066,87 @@
|
|
|
935
1066
|
}
|
|
936
1067
|
return result;
|
|
937
1068
|
}
|
|
938
|
-
var objGetOwnPropertyDescriptor = (
|
|
939
|
-
(
|
|
940
|
-
(
|
|
941
|
-
(
|
|
1069
|
+
var objGetOwnPropertyDescriptor = (_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
|
|
1070
|
+
(_pureAssign((_pureRef(ObjClass, "getOwnPropertyDescriptors")), polyObjGetOwnPropertyDescriptors));
|
|
1071
|
+
(_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_NAMES)), _returnEmptyArray));
|
|
1072
|
+
(_pureAssign((_pureRef(ObjClass, GET_OWN_PROPERTY_SYMBOLS)), _returnEmptyArray));
|
|
1073
|
+
var _fnToString;
|
|
1074
|
+
var _objCtrFnString;
|
|
1075
|
+
var _gblWindow;
|
|
1076
|
+
function isPlainObject(value) {
|
|
1077
|
+
if (!value || typeof value !== OBJECT) {
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
if (!_gblWindow) {
|
|
1081
|
+
_gblWindow = hasWindow() ? getWindow() : true;
|
|
1082
|
+
}
|
|
1083
|
+
var result = false;
|
|
1084
|
+
if (value !== _gblWindow) {
|
|
1085
|
+
if (!_objCtrFnString) {
|
|
1086
|
+
_fnToString = Function[PROTOTYPE][TO_STRING];
|
|
1087
|
+
_objCtrFnString = _fnToString[CALL](ObjClass);
|
|
1088
|
+
}
|
|
1089
|
+
try {
|
|
1090
|
+
var proto = objGetPrototypeOf(value);
|
|
1091
|
+
result = !proto;
|
|
1092
|
+
if (!result) {
|
|
1093
|
+
if (objHasOwnProperty(proto, CONSTRUCTOR)) {
|
|
1094
|
+
proto = proto[CONSTRUCTOR];
|
|
1095
|
+
}
|
|
1096
|
+
result = !!(proto && typeof proto === FUNCTION && _fnToString[CALL](proto) === _objCtrFnString);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
catch (ex) {
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return result;
|
|
1103
|
+
}
|
|
1104
|
+
function polyStrSymSplit(value, splitter, limit) {
|
|
1105
|
+
var splitFn = splitter ? splitter[getKnownSymbol(9 )] : UNDEF_VALUE;
|
|
1106
|
+
return splitFn ? splitFn(value, limit) : [value];
|
|
1107
|
+
}
|
|
1108
|
+
(_unwrapFunction("split", StrProto));
|
|
1109
|
+
(_unwrapFunctionWithPoly("split", StrProto, polyStrSymSplit));
|
|
1110
|
+
(_pureAssign((_pureRef(NumberCls, "isInteger")), _polyNumberIsInteger));
|
|
1111
|
+
function _polyNumberIsInteger(value) {
|
|
1112
|
+
return isNumber(value) && !isNaN(value) &&
|
|
1113
|
+
isFinite(value) &&
|
|
1114
|
+
mathFloor(value) === value;
|
|
1115
|
+
}
|
|
1116
|
+
function createLiteralRegex(matcher) {
|
|
1117
|
+
return new RegExp(strReplace(asString(matcher), /[.*+?^${}()|[\]\\]/g, "\\$&") || "(?:)", "g");
|
|
1118
|
+
}
|
|
1119
|
+
(_pureRef(MathCls, "abs"));
|
|
1120
|
+
(_pureRef(MathCls, "exp"));
|
|
1121
|
+
(_pureRef(MathCls, "log"));
|
|
1122
|
+
(_pureRef(MathCls, "asin"));
|
|
1123
|
+
(_pureRef(MathCls, "acos"));
|
|
1124
|
+
(_pureRef(MathCls, "atan"));
|
|
1125
|
+
(_pureRef(MathCls, "atan2"));
|
|
1126
|
+
(_pureRef(MathCls, "pow"));
|
|
1127
|
+
(_pureRef(MathCls, "sqrt"));
|
|
1128
|
+
(_pureRef(MathCls, "round"));
|
|
1129
|
+
(_pureRef(MathCls, "sin"));
|
|
1130
|
+
(_pureRef(MathCls, "cos"));
|
|
1131
|
+
(_pureRef(MathCls, "tan"));
|
|
942
1132
|
function polyObjFromEntries(entries) {
|
|
943
1133
|
var result = {};
|
|
1134
|
+
function _defineProtoValue(value) {
|
|
1135
|
+
Object.defineProperty(result, __PROTO__, {
|
|
1136
|
+
value: value,
|
|
1137
|
+
enumerable: true,
|
|
1138
|
+
configurable: true,
|
|
1139
|
+
writable: true
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
944
1142
|
function addEntry(entry) {
|
|
945
1143
|
if (isArray(entry) && entry.length >= 2) {
|
|
946
|
-
|
|
1144
|
+
if (entry[0] === __PROTO__) {
|
|
1145
|
+
_defineProtoValue(entry[1]);
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
result[entry[0]] = entry[1];
|
|
1149
|
+
}
|
|
947
1150
|
}
|
|
948
1151
|
}
|
|
949
1152
|
if (isArray(entries)) {
|
|
@@ -954,26 +1157,125 @@
|
|
|
954
1157
|
}
|
|
955
1158
|
return result;
|
|
956
1159
|
}
|
|
957
|
-
(
|
|
958
|
-
(
|
|
959
|
-
(
|
|
960
|
-
|
|
1160
|
+
(_pureAssign((_pureRef(ObjClass, "fromEntries")), polyObjFromEntries));
|
|
1161
|
+
(_pureAssign((_pureRef(ObjClass, "preventExtensions")), _doNothing));
|
|
1162
|
+
(_pureAssign((_pureRef(ObjClass, "isExtensible")), _returnFalse));
|
|
1163
|
+
var strIndexOf = (_unwrapFunction("indexOf", StrProto));
|
|
1164
|
+
(_unwrapFunction("lastIndexOf", StrProto));
|
|
1165
|
+
(_unwrapFunctionWithPoly("at", StrProto, polyStrAt));
|
|
1166
|
+
function polyStrAt(value, index) {
|
|
1167
|
+
_throwIfNullOrUndefined(value);
|
|
1168
|
+
return polyArrAt(asString(value), mathToInt(index));
|
|
1169
|
+
}
|
|
1170
|
+
(_unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
|
|
961
1171
|
function polyStrEndsWith(value, searchString, length) {
|
|
962
1172
|
_throwIfNotString(value);
|
|
963
1173
|
var searchValue = isString(searchString) ? searchString : asString(searchString);
|
|
964
1174
|
var end = (!isUndefined(length) && length < value[LENGTH]) ? length : value[LENGTH];
|
|
965
1175
|
return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
|
|
966
1176
|
}
|
|
967
|
-
|
|
968
|
-
( _unwrapFunction("lastIndexOf", StrProto));
|
|
969
|
-
( _unwrapFunctionWithPoly("includes", StrProto, polyStrIncludes));
|
|
1177
|
+
(_unwrapFunctionWithPoly("includes", StrProto, polyStrIncludes));
|
|
970
1178
|
function polyStrIncludes(value, searchString, position) {
|
|
971
1179
|
if (isRegExp(searchString)) {
|
|
972
1180
|
throwTypeError("'searchString' must not be a regular expression" + dumpObj(searchString));
|
|
973
1181
|
}
|
|
974
1182
|
return strIndexOf(value, asString(searchString), position) !== -1;
|
|
975
1183
|
}
|
|
976
|
-
(
|
|
1184
|
+
(_unwrapFunctionWithPoly("matchAll", StrProto, polyStrMatchAll));
|
|
1185
|
+
function _cloneRegExp(theRegex) {
|
|
1186
|
+
var flags = theRegex.flags;
|
|
1187
|
+
if (flags === undefined) {
|
|
1188
|
+
flags = EMPTY;
|
|
1189
|
+
theRegex.global && (flags += "g");
|
|
1190
|
+
theRegex.ignoreCase && (flags += "i");
|
|
1191
|
+
theRegex.multiline && (flags += "m");
|
|
1192
|
+
theRegex.dotAll && (flags += "s");
|
|
1193
|
+
theRegex.unicode && (flags += "u");
|
|
1194
|
+
theRegex.sticky && (flags += "y");
|
|
1195
|
+
}
|
|
1196
|
+
var result = new RegExp(theRegex.source, flags);
|
|
1197
|
+
result.lastIndex = mathMax(0, theRegex.lastIndex);
|
|
1198
|
+
return result;
|
|
1199
|
+
}
|
|
1200
|
+
function _advanceStringIndex(value, index, unicode) {
|
|
1201
|
+
var newIndex = index + 1;
|
|
1202
|
+
if (unicode) {
|
|
1203
|
+
if (index < value.length) {
|
|
1204
|
+
var first = value.charCodeAt(index);
|
|
1205
|
+
if (first >= 0xD800 && first <= 0xDBFF) {
|
|
1206
|
+
var second = value.charCodeAt(index + 1);
|
|
1207
|
+
if (second >= 0xDC00 && second <= 0xDFFF) {
|
|
1208
|
+
newIndex++;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
return newIndex;
|
|
1214
|
+
}
|
|
1215
|
+
function polyStrMatchAll(value, matcher) {
|
|
1216
|
+
_throwIfNullOrUndefined(value);
|
|
1217
|
+
var result;
|
|
1218
|
+
var matchSym = getKnownSymbol(4 );
|
|
1219
|
+
var isMatcherRegExp = isRegExp(matcher)
|
|
1220
|
+
&& (!matcher || isStrictNullOrUndefined(matcher[matchSym]) || matcher[matchSym] !== false);
|
|
1221
|
+
if (isMatcherRegExp && !matcher.global) {
|
|
1222
|
+
throwTypeError("matcher must be a global regular expression");
|
|
1223
|
+
}
|
|
1224
|
+
var theValue = asString(value);
|
|
1225
|
+
var matchAllFn = matcher && matcher[getKnownSymbol(5 )];
|
|
1226
|
+
if (isFunction(matchAllFn)) {
|
|
1227
|
+
result = matchAllFn.call(matcher, theValue);
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
var theRegex_1 = isMatcherRegExp ? _cloneRegExp(matcher) : new RegExp(matcher, "g");
|
|
1231
|
+
var ctx_1 = {
|
|
1232
|
+
n: function () {
|
|
1233
|
+
var match = theRegex_1.exec(theValue);
|
|
1234
|
+
if (!match) {
|
|
1235
|
+
return true;
|
|
1236
|
+
}
|
|
1237
|
+
if (match[0] === EMPTY) {
|
|
1238
|
+
theRegex_1.lastIndex = _advanceStringIndex(theValue, theRegex_1.lastIndex, !!theRegex_1.unicode);
|
|
1239
|
+
}
|
|
1240
|
+
ctx_1.v = match;
|
|
1241
|
+
return false;
|
|
1242
|
+
},
|
|
1243
|
+
v: undefined
|
|
1244
|
+
};
|
|
1245
|
+
result = createIterableIterator(ctx_1);
|
|
1246
|
+
}
|
|
1247
|
+
return result;
|
|
1248
|
+
}
|
|
1249
|
+
(_unwrapFunctionWithPoly("replaceAll", StrProto, polyStrReplaceAll));
|
|
1250
|
+
function polyStrReplaceAll(value, searchValue, replaceValue) {
|
|
1251
|
+
_throwIfNullOrUndefined(value);
|
|
1252
|
+
var matchSymbol = getKnownSymbol(4 );
|
|
1253
|
+
var replaceSymbol = getKnownSymbol(6 );
|
|
1254
|
+
var replaceFn;
|
|
1255
|
+
var matcher;
|
|
1256
|
+
var isRegex = isRegExp(searchValue);
|
|
1257
|
+
var theValue = isString(value) ? value : asString(value);
|
|
1258
|
+
var isSearchNotNull = searchValue || !isStrictNullOrUndefined(searchValue);
|
|
1259
|
+
if (isRegex && isSearchNotNull) {
|
|
1260
|
+
isRegex = searchValue[matchSymbol] !== false;
|
|
1261
|
+
}
|
|
1262
|
+
if (isRegex) {
|
|
1263
|
+
if (!searchValue.global) {
|
|
1264
|
+
throwTypeError("searchValue must be a global regular expression");
|
|
1265
|
+
}
|
|
1266
|
+
matcher = searchValue;
|
|
1267
|
+
}
|
|
1268
|
+
else {
|
|
1269
|
+
replaceFn = isSearchNotNull ? searchValue[replaceSymbol] : null;
|
|
1270
|
+
if (isFunction(replaceFn)) {
|
|
1271
|
+
return replaceFn.call(searchValue, theValue, replaceValue);
|
|
1272
|
+
}
|
|
1273
|
+
var search = isString(searchValue) ? searchValue : asString(searchValue);
|
|
1274
|
+
matcher = createLiteralRegex(search);
|
|
1275
|
+
}
|
|
1276
|
+
return strReplace(theValue, matcher, replaceValue);
|
|
1277
|
+
}
|
|
1278
|
+
(_unwrapFunctionWithPoly("startsWith", StrProto, polyStrStartsWith));
|
|
977
1279
|
function polyStrStartsWith(value, searchString, position) {
|
|
978
1280
|
_throwIfNotString(value);
|
|
979
1281
|
var searchValue = isString(searchString) ? searchString : asString(searchString);
|
|
@@ -1124,9 +1426,11 @@
|
|
|
1124
1426
|
var DynInstFuncTable = '_dynInstFuncs';
|
|
1125
1427
|
var DynProxyTag = '_isDynProxy';
|
|
1126
1428
|
var DynClassName = '_dynClass';
|
|
1429
|
+
var DynBaseProtoFuncs = '_dynBaseFuncs';
|
|
1127
1430
|
var DynClassNamePrefix = '_dynCls$';
|
|
1128
1431
|
var DynInstChkTag = '_dynInstChk';
|
|
1129
1432
|
var DynAllowInstChkTag = DynInstChkTag;
|
|
1433
|
+
var DynResolvedCachePrefix = '_dyn_r$';
|
|
1130
1434
|
var DynProtoDefaultOptions = '_dfOpts';
|
|
1131
1435
|
var UnknownValue = '_unknown_';
|
|
1132
1436
|
var str__Proto = "__proto__";
|
|
@@ -1209,6 +1513,25 @@
|
|
|
1209
1513
|
}
|
|
1210
1514
|
return false;
|
|
1211
1515
|
}
|
|
1516
|
+
function _getBaseProtoFuncs(classProto) {
|
|
1517
|
+
if (objHasOwnProperty(classProto, DynBaseProtoFuncs)) {
|
|
1518
|
+
return classProto[DynBaseProtoFuncs];
|
|
1519
|
+
}
|
|
1520
|
+
var baseFuncSources = objCreate(null);
|
|
1521
|
+
var baseProto = _getObjProto(classProto);
|
|
1522
|
+
var visited = [];
|
|
1523
|
+
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
1524
|
+
_forEachProp(baseProto, function (name) {
|
|
1525
|
+
if (!baseFuncSources[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
|
|
1526
|
+
baseFuncSources[name] = baseProto;
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
visited.push(baseProto);
|
|
1530
|
+
baseProto = _getObjProto(baseProto);
|
|
1531
|
+
}
|
|
1532
|
+
classProto[DynBaseProtoFuncs] = baseFuncSources;
|
|
1533
|
+
return baseFuncSources;
|
|
1534
|
+
}
|
|
1212
1535
|
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
1213
1536
|
function _instFuncProxy(target, funcHost, funcName) {
|
|
1214
1537
|
var theFunc = funcHost[funcName];
|
|
@@ -1226,16 +1549,11 @@
|
|
|
1226
1549
|
_forEachProp(instFuncs, function (name) {
|
|
1227
1550
|
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
1228
1551
|
});
|
|
1229
|
-
var
|
|
1230
|
-
var
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
visited.push(baseProto);
|
|
1238
|
-
baseProto = _getObjProto(baseProto);
|
|
1552
|
+
var baseFuncSources = _getBaseProtoFuncs(classProto);
|
|
1553
|
+
for (var name_2 in baseFuncSources) {
|
|
1554
|
+
if (!baseFuncs[name_2]) {
|
|
1555
|
+
baseFuncs[name_2] = _instFuncProxy(thisTarget, baseFuncSources[name_2], name_2);
|
|
1556
|
+
}
|
|
1239
1557
|
}
|
|
1240
1558
|
return baseFuncs;
|
|
1241
1559
|
}
|
|
@@ -1249,16 +1567,18 @@
|
|
|
1249
1567
|
}
|
|
1250
1568
|
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
1251
1569
|
var canAddInst = !objHasOwnProperty(target, funcName);
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1570
|
+
if (canAddInst) {
|
|
1571
|
+
var objProto = _getObjProto(target);
|
|
1572
|
+
var visited = [];
|
|
1573
|
+
while (objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
1574
|
+
var protoFunc = objProto[funcName];
|
|
1575
|
+
if (protoFunc) {
|
|
1576
|
+
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
1577
|
+
break;
|
|
1578
|
+
}
|
|
1579
|
+
visited.push(objProto);
|
|
1580
|
+
objProto = _getObjProto(objProto);
|
|
1259
1581
|
}
|
|
1260
|
-
visited.push(objProto);
|
|
1261
|
-
objProto = _getObjProto(objProto);
|
|
1262
1582
|
}
|
|
1263
1583
|
try {
|
|
1264
1584
|
if (canAddInst) {
|
|
@@ -1285,25 +1605,34 @@
|
|
|
1285
1605
|
}
|
|
1286
1606
|
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
1287
1607
|
function _createDynamicPrototype(proto, funcName) {
|
|
1608
|
+
var cacheKey = DynResolvedCachePrefix + className + "." + funcName;
|
|
1288
1609
|
var dynProtoProxy = function () {
|
|
1289
|
-
var
|
|
1610
|
+
var instFuncTable = this[DynInstFuncTable];
|
|
1611
|
+
var instFunc = instFuncTable ? instFuncTable[cacheKey] : undefined;
|
|
1612
|
+
if (!instFunc) {
|
|
1613
|
+
instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
1614
|
+
if (instFuncTable) {
|
|
1615
|
+
instFuncTable[cacheKey] = instFunc;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1290
1618
|
return instFunc.apply(this, arguments);
|
|
1291
1619
|
};
|
|
1292
1620
|
dynProtoProxy[DynProxyTag] = 1;
|
|
1293
1621
|
return dynProtoProxy;
|
|
1294
1622
|
}
|
|
1295
1623
|
if (!_isObjectOrArrayPrototype(proto)) {
|
|
1296
|
-
var
|
|
1297
|
-
if (!_isObjectOrArrayPrototype(
|
|
1298
|
-
var instFuncs_1 =
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1624
|
+
var instFuncTable_1 = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);
|
|
1625
|
+
if (!_isObjectOrArrayPrototype(instFuncTable_1)) {
|
|
1626
|
+
var instFuncs_1 = instFuncTable_1[className] = (instFuncTable_1[className] || objCreate(null));
|
|
1627
|
+
if (instFuncTable_1[DynAllowInstChkTag] !== false) {
|
|
1628
|
+
instFuncTable_1[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
1301
1629
|
}
|
|
1302
1630
|
if (!_isObjectOrArrayPrototype(instFuncs_1)) {
|
|
1303
1631
|
_forEachProp(target, function (name) {
|
|
1304
1632
|
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
1305
1633
|
instFuncs_1[name] = target[name];
|
|
1306
1634
|
delete target[name];
|
|
1635
|
+
delete instFuncTable_1[DynResolvedCachePrefix + className + "." + name];
|
|
1307
1636
|
if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
1308
1637
|
proto[name] = _createDynamicPrototype(proto, name);
|
|
1309
1638
|
}
|
|
@@ -1608,7 +1937,7 @@
|
|
|
1608
1937
|
return result;
|
|
1609
1938
|
}
|
|
1610
1939
|
|
|
1611
|
-
var version =
|
|
1940
|
+
var version = "3.4.3-nightly3.2606-03";
|
|
1612
1941
|
var instanceName = "." + newId(6);
|
|
1613
1942
|
var _dataUid = 0;
|
|
1614
1943
|
function _canAcceptData(target) {
|