mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Ensure optimized isPlainObject works with objects from other documents.
Former-commit-id: 2f782b3dfc19e7ea3274132c31cd408ee2387021
This commit is contained in:
13
build.js
13
build.js
@@ -572,17 +572,6 @@
|
||||
return source.replace(/(?:\s*\/\/.*)*\n( +)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the `isPlainObject` fallback from `source`.
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The source to process.
|
||||
* @returns {String} Returns the source with the `isPlainObject` fallback removed.
|
||||
*/
|
||||
function removeIsPlainObjectFallback(source) {
|
||||
return source.replace(/(?:\s*\/\/.*)*\n( +)if *\(!isPlainObject[\s\S]+?};\n\1}/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the `Object.keys` object iteration optimization from `source`.
|
||||
*
|
||||
@@ -1003,7 +992,6 @@
|
||||
|
||||
if (!isUnderscore) {
|
||||
source = removeIsArgumentsFallback(source);
|
||||
source = removeIsPlainObjectFallback(source);
|
||||
source = removeNoArgsClass(source);
|
||||
}
|
||||
|
||||
@@ -1131,7 +1119,6 @@
|
||||
source = removeVar(source, 'reNative');
|
||||
}
|
||||
if (isRemoved(source, 'createIterator', 'clone', 'merge')) {
|
||||
source = removeIsPlainObjectFallback(source);
|
||||
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var iteratesOwnLast;|.+?iteratesOwnLast *=.+/g, '');
|
||||
}
|
||||
if (isRemoved(source, 'createIterator', 'isEqual')) {
|
||||
|
||||
Reference in New Issue
Block a user