mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Fix string test fails for _.matchesProperty, _.property, & _.result in IE 6 & 7.
This commit is contained in:
@@ -2510,6 +2510,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var key = pathKey;
|
var key = pathKey;
|
||||||
|
object = toObject(object);
|
||||||
if ((isArr || !isCommon) && !(key in object)) {
|
if ((isArr || !isCommon) && !(key in object)) {
|
||||||
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
@@ -2639,7 +2640,7 @@
|
|||||||
*/
|
*/
|
||||||
function baseProperty(key) {
|
function baseProperty(key) {
|
||||||
return function(object) {
|
return function(object) {
|
||||||
return object == null ? undefined : object[key];
|
return object == null ? undefined : toObject(object)[key];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9934,7 +9935,7 @@
|
|||||||
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
||||||
path = last(path);
|
path = last(path);
|
||||||
}
|
}
|
||||||
var result = object == null ? undefined : object[path];
|
var result = object == null ? undefined : toObject(object)[path];
|
||||||
if (typeof result == 'undefined') {
|
if (typeof result == 'undefined') {
|
||||||
result = defaultValue;
|
result = defaultValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user