Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / isArguments.js
1 var isArrayLikeObject = require('./isArrayLikeObject');
2
3 /** `Object#toString` result references. */
4 var argsTag = '[object Arguments]';
5
6 /** Used for built-in method references. */
7 var objectProto = Object.prototype;
8
9 /** Used to check objects for own properties. */
10 var hasOwnProperty = objectProto.hasOwnProperty;
11
12 /**
13  * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
14  * of values.
15  */
16 var objectToString = objectProto.toString;
17
18 /** Built-in value references. */
19 var propertyIsEnumerable = objectProto.propertyIsEnumerable;
20
21 /**
22  * Checks if `value` is likely an `arguments` object.
23  *
24  * @static
25  * @memberOf _
26  * @category Lang
27  * @param {*} value The value to check.
28  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
29  * @example
30  *
31  * _.isArguments(function() { return arguments; }());
32  * // => true
33  *
34  * _.isArguments([1, 2, 3]);
35  * // => false
36  */
37 function isArguments(value) {
38   // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
39   return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
40     (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
41 }
42
43 module.exports = isArguments;