Ensure optimized isPlainObject works with objects from other documents.

Former-commit-id: 2f782b3dfc19e7ea3274132c31cd408ee2387021
This commit is contained in:
John-David Dalton
2012-09-02 02:35:02 -07:00
parent c2117ef4fd
commit f3bec4fc37
4 changed files with 75 additions and 71 deletions

View File

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