Avoid a JIT bug in Safari 9 for baseIteratee.

This commit is contained in:
John-David Dalton
2016-03-30 19:50:11 -07:00
parent 55c3299d5c
commit c36d0af5cd
2 changed files with 7 additions and 6 deletions

View File

@@ -3108,14 +3108,15 @@
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
var type = typeof value;
if (type == 'function') {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (type == 'object') {
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);