summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/lodash/_arrayLikeKeys.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-10-15 11:30:25 -0700
committerRich Trott <rtrott@gmail.com>2016-10-18 15:28:21 -0700
commit2981f24f926da32d708c8bb39d90fff5aa73bc3f (patch)
treee154567c25398160dfe9ac8e27dd79c65a436272 /tools/eslint/node_modules/lodash/_arrayLikeKeys.js
parent150dc5c2e6a848aa49bb95f4e6c0cbf0da5d0e73 (diff)
downloadnode-new-2981f24f926da32d708c8bb39d90fff5aa73bc3f.tar.gz
tools: update ESLint to v3.8.0
Update ESLint to v3.8.0. * Installed with `npm install --production` to avoid installing unnecessary dev files * Used `dmn -f clean` to further eliminate unneeded files PR-URL: https://github.com/nodejs/node/pull/9112 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'tools/eslint/node_modules/lodash/_arrayLikeKeys.js')
-rw-r--r--tools/eslint/node_modules/lodash/_arrayLikeKeys.js30
1 files changed, 20 insertions, 10 deletions
diff --git a/tools/eslint/node_modules/lodash/_arrayLikeKeys.js b/tools/eslint/node_modules/lodash/_arrayLikeKeys.js
index 0cb3b18556..b2ec9ce786 100644
--- a/tools/eslint/node_modules/lodash/_arrayLikeKeys.js
+++ b/tools/eslint/node_modules/lodash/_arrayLikeKeys.js
@@ -1,7 +1,9 @@
var baseTimes = require('./_baseTimes'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
- isIndex = require('./_isIndex');
+ isBuffer = require('./isBuffer'),
+ isIndex = require('./_isIndex'),
+ isTypedArray = require('./isTypedArray');
/** Used for built-in method references. */
var objectProto = Object.prototype;
@@ -18,18 +20,26 @@ var hasOwnProperty = objectProto.hasOwnProperty;
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- // Safari 9 makes `arguments.length` enumerable in strict mode.
- var result = (isArray(value) || isArguments(value))
- ? baseTimes(value.length, String)
- : [];
-
- var length = result.length,
- skipIndexes = !!length;
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
+ !(skipIndexes && (
+ // Safari 9 has enumerable `arguments.length` in strict mode.
+ key == 'length' ||
+ // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == 'offset' || key == 'parent')) ||
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
+ // Skip index properties.
+ isIndex(key, length)
+ ))) {
result.push(key);
}
}