summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js')
-rw-r--r--tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js
new file mode 100644
index 0000000000..b8beed225b
--- /dev/null
+++ b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var isFunction = require('../function/is-function')
+ , isObject = require('./is-object');
+
+module.exports = function (x) {
+ return ((x != null) && (typeof x.length === 'number') &&
+
+ // Just checking ((typeof x === 'object') && (typeof x !== 'function'))
+ // won't work right for some cases, e.g.:
+ // type of instance of NodeList in Safari is a 'function'
+
+ ((isObject(x) && !isFunction(x)) || (typeof x === "string"))) || false;
+};