Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]

Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
This commit is contained in:
John-David Dalton
2013-05-25 01:08:08 -07:00
parent d15bd23800
commit d28cc15be2
3 changed files with 35 additions and 35 deletions

View File

@@ -1319,14 +1319,11 @@
source = removeFunction(source, 'isNode');
source = removeSupportProp(source, 'nodeClass');
// remove `support.nodeClass` from `shimIsPlainObject`
source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) {
return match.replace(/\(support\.nodeClass[\s\S]+?\)\)/, 'true');
});
// remove `support.nodeClass` from `_.clone`
source = source.replace(matchFunction(source, 'clone'), function(match) {
return match.replace(/\s*\|\|\s*\(!support\.nodeClass[\s\S]+?\)\)/, '');
// remove `support.nodeClass` from `_.clone` and `shimIsPlainObject`
_.each(['clone', 'shimIsPlainObject'], function(methodName) {
source = source.replace(matchFunction(source, methodName), function(match) {
return match.replace(/\s*\|\|\s*\(!support\.nodeClass[\s\S]+?\)\)/, '');
});
});
// remove `support.nodeClass` from `_.isEqual`