Files
lodash/_getSymbols.js
John-David Dalton 18d0f1d873 Bump to v4.7.0.
2016-03-31 08:47:39 -07:00

25 lines
650 B
JavaScript

/** Built-in value references. */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbol properties of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
function getSymbols(object) {
// Coerce `object` to an object to avoid non-object errors in V8.
// See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
return getOwnPropertySymbols(Object(object));
}
// Fallback for IE < 11.
if (!getOwnPropertySymbols) {
getSymbols = function() {
return [];
};
}
module.exports = getSymbols;