Exit early from getSymbols if object is nullish.

This commit is contained in:
John-David Dalton
2016-11-25 00:03:29 -06:00
parent 2f92d55024
commit 72f559e1a3

View File

@@ -6050,6 +6050,9 @@
* @returns {Array} Returns the array of symbols. * @returns {Array} Returns the array of symbols.
*/ */
var getSymbols = !nativeGetSymbols ? stubArray : function(object) { var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object); object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) { return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol); return propertyIsEnumerable.call(object, symbol);