From 1dddf27a39bac9891fac1110af9a87b001c5b584 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 23 Nov 2016 11:26:18 -0600 Subject: [PATCH] Include only enumerable symbols in `getSymbols` result. [closes #2845] --- lodash.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 5a750c2d5..4c9413215 100644 --- a/lodash.js +++ b/lodash.js @@ -6056,7 +6056,11 @@ * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; /** * Creates an array of the own and inherited enumerable symbols of `object`.