Remove check for existence of getOwnPropertySymbols (#4102)

This commit is contained in:
Luiz Américo
2018-12-05 02:10:48 -02:00
committed by John-David Dalton
parent 8eccdd098a
commit 151e316263
2 changed files with 2 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
const getSymbols = !nativeGetSymbols ? () => [] : (object) => {
function getSymbols (object) {
if (object == null) {
return []
}

View File

@@ -1,8 +1,5 @@
import getSymbols from './getSymbols.js'
/* Built-in method references for those with the same name as other `lodash` methods. */
const nativeGetSymbols = Object.getOwnPropertySymbols
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
@@ -10,7 +7,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
const getSymbolsIn = !nativeGetSymbols ? () => [] : (object) => {
function getSymbolsIn (object) {
const result = []
while (object) {
result.push(...getSymbols(object))