diff options
author | Rich Trott <rtrott@gmail.com> | 2016-07-07 15:44:32 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-07-11 13:47:20 -0700 |
commit | e8a7003e940928e2d1684c12881dd2a39af2d7cc (patch) | |
tree | 92264eb4c317b287366e7774f6d4e15000856e06 /tools/eslint/node_modules/lodash/_stackSet.js | |
parent | fcae5e2d9187b4a9c16cbce843c10e2087990946 (diff) | |
download | android-node-v8-e8a7003e940928e2d1684c12881dd2a39af2d7cc.tar.gz android-node-v8-e8a7003e940928e2d1684c12881dd2a39af2d7cc.tar.bz2 android-node-v8-e8a7003e940928e2d1684c12881dd2a39af2d7cc.zip |
tools: update ESLint, fix unused vars bug
Update ESLint to 3.0.0. This includes an enhancement to `no-unused-vars`
such that it finds a few instances in our code base that it did not find
previously (fixed in previous commits readying this for landing).
PR-URL: https://github.com/nodejs/node/pull/7601
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'tools/eslint/node_modules/lodash/_stackSet.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/_stackSet.js | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tools/eslint/node_modules/lodash/_stackSet.js b/tools/eslint/node_modules/lodash/_stackSet.js index 76ca89a8df..0380ee54c0 100644 --- a/tools/eslint/node_modules/lodash/_stackSet.js +++ b/tools/eslint/node_modules/lodash/_stackSet.js @@ -1,5 +1,5 @@ -var MapCache = require('./_MapCache'), - assocSet = require('./_assocSet'); +var ListCache = require('./_ListCache'), + MapCache = require('./_MapCache'); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -15,21 +15,11 @@ var LARGE_ARRAY_SIZE = 200; * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); + var cache = this.__data__; + if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { + cache = this.__data__ = new MapCache(cache.__data__); } + cache.set(key, value); return this; } |