diff options
author | Rich Trott <rtrott@gmail.com> | 2018-03-21 22:44:47 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-03-24 04:11:48 -0700 |
commit | 0863a0e528ba9ee01f960dce7ffebe8fff3a774c (patch) | |
tree | 37990f3af668c242ec1c4a9e24afd31b720ad96d /tools/node_modules/eslint/node_modules/lodash/_baseClone.js | |
parent | 5e00a013eb219716d952cb8eb29a134c00f5db54 (diff) | |
download | android-node-v8-0863a0e528ba9ee01f960dce7ffebe8fff3a774c.tar.gz android-node-v8-0863a0e528ba9ee01f960dce7ffebe8fff3a774c.tar.bz2 android-node-v8-0863a0e528ba9ee01f960dce7ffebe8fff3a774c.zip |
tools: update ESLint to 4.19.1
A few bug fixes result in more stringent linting rules.
PR-URL: https://github.com/nodejs/node/pull/19528
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/node_modules/lodash/_baseClone.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/lodash/_baseClone.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/node_modules/eslint/node_modules/lodash/_baseClone.js b/tools/node_modules/eslint/node_modules/lodash/_baseClone.js index 7c27a37d32..6f73684f2a 100644 --- a/tools/node_modules/eslint/node_modules/lodash/_baseClone.js +++ b/tools/node_modules/eslint/node_modules/lodash/_baseClone.js @@ -15,7 +15,9 @@ var Stack = require('./_Stack'), initCloneObject = require('./_initCloneObject'), isArray = require('./isArray'), isBuffer = require('./isBuffer'), + isMap = require('./isMap'), isObject = require('./isObject'), + isSet = require('./isSet'), keys = require('./keys'); /** Used to compose bitmasks for cloning. */ @@ -123,7 +125,7 @@ function baseClone(value, bitmask, customizer, key, object, stack) { if (!cloneableTags[tag]) { return object ? value : {}; } - result = initCloneByTag(value, tag, baseClone, isDeep); + result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. @@ -134,6 +136,22 @@ function baseClone(value, bitmask, customizer, key, object, stack) { } stack.set(value, result); + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); |