Assume Symbol is always defined (#4111)

This commit is contained in:
Luiz Américo
2018-12-10 21:28:20 -03:00
committed by John-David Dalton
parent 4c55ea7068
commit 6cb1f71adf
7 changed files with 8 additions and 11 deletions

View File

@@ -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)