Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / lang / isArguments.js
1 var isArrayLike = require('../internal/isArrayLike'),
2     isObjectLike = require('../internal/isObjectLike');
3
4 /** Used for native method references. */
5 var objectProto = Object.prototype;
6
7 /** Used to check objects for own properties. */
8 var hasOwnProperty = objectProto.hasOwnProperty;
9
10 /** Native method references. */
11 var propertyIsEnumerable = objectProto.propertyIsEnumerable;
12
13 /**
14  * Checks if `value` is classified as an `arguments` object.
15  *
16  * @static
17  * @memberOf _
18  * @category Lang
19  * @param {*} value The value to check.
20  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
21  * @example
22  *
23  * _.isArguments(function() { return arguments; }());
24  * // => true
25  *
26  * _.isArguments([1, 2, 3]);
27  * // => false
28  */
29 function isArguments(value) {
30   return isObjectLike(value) && isArrayLike(value) &&
31     hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
32 }
33
34 module.exports = isArguments;