mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Assume Symbol is always defined (#4111)
This commit is contained in:
committed by
John-David Dalton
parent
4c55ea7068
commit
6cb1f71adf
@@ -1,7 +1,7 @@
|
||||
const objectProto = Object.prototype
|
||||
const hasOwnProperty = objectProto.hasOwnProperty
|
||||
const toString = objectProto.toString
|
||||
const symToStringTag = typeof Symbol != 'undefined' ? Symbol.toStringTag : undefined
|
||||
const symToStringTag = Symbol.toStringTag
|
||||
|
||||
/**
|
||||
* The base implementation of `getTag` without fallbacks for buggy environments.
|
||||
@@ -14,7 +14,7 @@ function baseGetTag(value) {
|
||||
if (value == null) {
|
||||
return value === undefined ? '[object Undefined]' : '[object Null]'
|
||||
}
|
||||
if (!(symToStringTag && symToStringTag in Object(value))) {
|
||||
if (!(symToStringTag in Object(value))) {
|
||||
return toString.call(value)
|
||||
}
|
||||
const isOwn = hasOwnProperty.call(value, symToStringTag)
|
||||
|
||||
Reference in New Issue
Block a user