mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Simplify getSymbols fallback.
This commit is contained in:
@@ -5461,16 +5461,11 @@
|
|||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
* @returns {Array} Returns the array of symbols.
|
* @returns {Array} Returns the array of symbols.
|
||||||
*/
|
*/
|
||||||
function getSymbols(object) {
|
var getSymbols = !getOwnPropertySymbols ? stubArray : function(object) {
|
||||||
// Coerce `object` to an object to avoid non-object errors in V8.
|
// 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.
|
// See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
|
||||||
return getOwnPropertySymbols(Object(object));
|
return getOwnPropertySymbols(Object(object));
|
||||||
}
|
};
|
||||||
|
|
||||||
// Fallback for IE < 11.
|
|
||||||
if (!getOwnPropertySymbols) {
|
|
||||||
getSymbols = stubArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of the own and inherited enumerable symbol properties
|
* Creates an array of the own and inherited enumerable symbol properties
|
||||||
|
|||||||
Reference in New Issue
Block a user