|
12 | 12 | var undefined;
|
13 | 13 |
|
14 | 14 | /** Used as the semantic version number. */
|
15 |
| - var VERSION = '4.16.2'; |
| 15 | + var VERSION = '4.16.3'; |
16 | 16 |
|
17 | 17 | /** Used as the size to enable large array optimizations. */
|
18 | 18 | var LARGE_ARRAY_SIZE = 200;
|
|
95 | 95 | numberTag = '[object Number]',
|
96 | 96 | objectTag = '[object Object]',
|
97 | 97 | promiseTag = '[object Promise]',
|
| 98 | + proxyTag = '[object Proxy]', |
98 | 99 | regexpTag = '[object RegExp]',
|
99 | 100 | setTag = '[object Set]',
|
100 | 101 | stringTag = '[object String]',
|
|
1469 | 1470 | Symbol = context.Symbol,
|
1470 | 1471 | Uint8Array = context.Uint8Array,
|
1471 | 1472 | allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
1472 |
| - defineProperty = Object.defineProperty, |
1473 | 1473 | getPrototype = overArg(Object.getPrototypeOf, Object),
|
1474 | 1474 | iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
1475 | 1475 | objectCreate = Object.create,
|
1476 | 1476 | propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
1477 | 1477 | splice = arrayProto.splice,
|
1478 | 1478 | spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
1479 | 1479 |
|
| 1480 | + var defineProperty = (function() { |
| 1481 | + try { |
| 1482 | + var func = getNative(Object, 'defineProperty'); |
| 1483 | + func({}, '', {}); |
| 1484 | + return func; |
| 1485 | + } catch (e) {} |
| 1486 | + }()); |
| 1487 | + |
1480 | 1488 | /** Mocked built-ins. */
|
1481 | 1489 | var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
1482 | 1490 | ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
|
1503 | 1511 | Promise = getNative(context, 'Promise'),
|
1504 | 1512 | Set = getNative(context, 'Set'),
|
1505 | 1513 | WeakMap = getNative(context, 'WeakMap'),
|
1506 |
| - nativeCreate = getNative(Object, 'create'), |
1507 |
| - nativeDefineProperty = getNative(Object, 'defineProperty'); |
| 1514 | + nativeCreate = getNative(Object, 'create'); |
1508 | 1515 |
|
1509 | 1516 | /** Used to store function metadata. */
|
1510 | 1517 | var metaMap = WeakMap && new WeakMap;
|
|
1672 | 1679 | if (objectCreate) {
|
1673 | 1680 | return objectCreate(proto);
|
1674 | 1681 | }
|
1675 |
| - object.prototype = prototype; |
| 1682 | + object.prototype = proto; |
1676 | 1683 | var result = new object;
|
1677 | 1684 | object.prototype = undefined;
|
1678 | 1685 | return result;
|
|
2462 | 2469 | */
|
2463 | 2470 | function assignMergeValue(object, key, value) {
|
2464 | 2471 | if ((value !== undefined && !eq(object[key], value)) ||
|
2465 |
| - (typeof key == 'number' && value === undefined && !(key in object))) { |
| 2472 | + (value === undefined && !(key in object))) { |
2466 | 2473 | baseAssignValue(object, key, value);
|
2467 | 2474 | }
|
2468 | 2475 | }
|
|
3271 | 3278 | othIsObj = othTag == objectTag,
|
3272 | 3279 | isSameTag = objTag == othTag;
|
3273 | 3280 |
|
| 3281 | + if (isSameTag && isBuffer(object)) { |
| 3282 | + if (!isBuffer(other)) { |
| 3283 | + return false; |
| 3284 | + } |
| 3285 | + objIsArr = true; |
| 3286 | + objIsObj = false; |
| 3287 | + } |
3274 | 3288 | if (isSameTag && !objIsObj) {
|
3275 | 3289 | stack || (stack = new Stack);
|
3276 | 3290 | return (objIsArr || isTypedArray(object))
|
|
3616 | 3630 | var isCommon = newValue === undefined;
|
3617 | 3631 |
|
3618 | 3632 | if (isCommon) {
|
| 3633 | + var isArr = isArray(srcValue), |
| 3634 | + isTyped = !isArr && isTypedArray(srcValue); |
| 3635 | + |
3619 | 3636 | newValue = srcValue;
|
3620 |
| - if (isArray(srcValue) || isTypedArray(srcValue)) { |
| 3637 | + if (isArr || isTyped) { |
3621 | 3638 | if (isArray(objValue)) {
|
3622 | 3639 | newValue = objValue;
|
3623 | 3640 | }
|
3624 | 3641 | else if (isArrayLikeObject(objValue)) {
|
3625 | 3642 | newValue = copyArray(objValue);
|
3626 | 3643 | }
|
3627 |
| - else { |
| 3644 | + else if (isTyped) { |
3628 | 3645 | isCommon = false;
|
3629 |
| - newValue = baseClone(srcValue, true); |
| 3646 | + newValue = cloneTypedArray(srcValue, true); |
| 3647 | + } |
| 3648 | + else { |
| 3649 | + newValue = []; |
3630 | 3650 | }
|
3631 | 3651 | }
|
3632 | 3652 | else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
| 3653 | + newValue = objValue; |
3633 | 3654 | if (isArguments(objValue)) {
|
3634 | 3655 | newValue = toPlainObject(objValue);
|
3635 | 3656 | }
|
3636 | 3657 | else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
3637 |
| - isCommon = false; |
3638 |
| - newValue = baseClone(srcValue, true); |
3639 |
| - } |
3640 |
| - else { |
3641 |
| - newValue = objValue; |
| 3658 | + newValue = initCloneObject(srcValue); |
3642 | 3659 | }
|
3643 | 3660 | }
|
3644 | 3661 | else {
|
|
3984 | 4001 | * @param {Function} string The `toString` result.
|
3985 | 4002 | * @returns {Function} Returns `func`.
|
3986 | 4003 | */
|
3987 |
| - var baseSetToString = !nativeDefineProperty ? identity : function(func, string) { |
3988 |
| - return nativeDefineProperty(func, 'toString', { |
| 4004 | + var baseSetToString = !defineProperty ? identity : function(func, string) { |
| 4005 | + return defineProperty(func, 'toString', { |
3989 | 4006 | 'configurable': true,
|
3990 | 4007 | 'enumerable': false,
|
3991 | 4008 | 'value': constant(string),
|
|
11555 | 11572 | // The use of `Object#toString` avoids issues with the `typeof` operator
|
11556 | 11573 | // in Safari 8-9 which returns 'object' for typed array and other constructors.
|
11557 | 11574 | var tag = isObject(value) ? objectToString.call(value) : '';
|
11558 |
| - return tag == funcTag || tag == genTag; |
| 11575 | + return tag == funcTag || tag == genTag || tag == proxyTag; |
11559 | 11576 | }
|
11560 | 11577 |
|
11561 | 11578 | /**
|
|
0 commit comments