mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Ensure getOwnPropertySymbols is passed an object to avoid errors in V8.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -5063,9 +5063,18 @@
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of symbols.
|
||||
*/
|
||||
var getSymbols = getOwnPropertySymbols || function() {
|
||||
return [];
|
||||
};
|
||||
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 [];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable symbol properties
|
||||
|
||||
Reference in New Issue
Block a user