e598c10e341b7bf182ba579ca54d44ae1bd336b6
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _isHostObject.js
1 /**
2  * Checks if `value` is a host object in IE < 9.
3  *
4  * @private
5  * @param {*} value The value to check.
6  * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
7  */
8 function isHostObject(value) {
9   // Many host objects are `Object` objects that can coerce to strings
10   // despite having improperly defined `toString` methods.
11   var result = false;
12   if (value != null && typeof value.toString != 'function') {
13     try {
14       result = !!(value + '');
15     } catch (e) {}
16   }
17   return result;
18 }
19
20 module.exports = isHostObject;