mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Add removeSpliceObjectsFix to build.js.
Former-commit-id: efa1a3882849d2eb2eb01adaf03a1edca201f76e
This commit is contained in:
40
build.js
40
build.js
@@ -1345,7 +1345,7 @@
|
|||||||
return modified;
|
return modified;
|
||||||
});
|
});
|
||||||
|
|
||||||
return removeFromCreateIterator(source, funcName);
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1495,6 +1495,18 @@
|
|||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the `support.spliceObjects` fix from the `Array` function mixins
|
||||||
|
* snippet of `source`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {String} source The source to inspect.
|
||||||
|
* @returns {String} Returns the modified source.
|
||||||
|
*/
|
||||||
|
function removeSpliceObjectsFix(source) {
|
||||||
|
return source.replace(/(?:\s*\/\/.*)*\n( *)if *\(!support\.spliceObjects[\s\S]+?(?:\{\s*}|\n\1})/, '');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all strings from `source`.
|
* Removes all strings from `source`.
|
||||||
*
|
*
|
||||||
@@ -1514,18 +1526,7 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function removeSupport(source) {
|
function removeSupport(source) {
|
||||||
source = source.replace(getSupport(source), '');
|
return source.replace(getSupport(source), '');
|
||||||
|
|
||||||
_.each([
|
|
||||||
removeSupportArgsClass, removeSupportArgsObject, removeSupportEnumErrorProps,
|
|
||||||
removeSupportEnumPrototypes, removeSupportNodeClass, removeSupportNonEnumArgs,
|
|
||||||
removeSupportNonEnumShadows, removeSupportOwnLast, removeSupportSpliceObjects,
|
|
||||||
removeSupportUnindexedChars
|
|
||||||
], function(func) {
|
|
||||||
source = func(source);
|
|
||||||
});
|
|
||||||
|
|
||||||
return source;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1684,9 +1685,11 @@
|
|||||||
*/
|
*/
|
||||||
function removeSupportNonEnumShadows(source) {
|
function removeSupportNonEnumShadows(source) {
|
||||||
source = removeSupportProp(source, 'nonEnumShadows');
|
source = removeSupportProp(source, 'nonEnumShadows');
|
||||||
source = removeVar(source, 'nonEnumProps');
|
|
||||||
source = removeFromCreateIterator(source, 'shadowedProps');
|
source = removeFromCreateIterator(source, 'shadowedProps');
|
||||||
|
|
||||||
|
source = removeVar(source, 'nonEnumProps');
|
||||||
|
source = removeFromCreateIterator(source, 'nonEnumProps');
|
||||||
|
|
||||||
// remove nested `nonEnumProps` assignments
|
// remove nested `nonEnumProps` assignments
|
||||||
source = source.replace(/^ *\(function[\s\S]+?\n *var length\b[\s\S]+?shadowedProps[\s\S]+?}\(\)\);\n/m, '');
|
source = source.replace(/^ *\(function[\s\S]+?\n *var length\b[\s\S]+?shadowedProps[\s\S]+?}\(\)\);\n/m, '');
|
||||||
|
|
||||||
@@ -1725,10 +1728,7 @@
|
|||||||
*/
|
*/
|
||||||
function removeSupportSpliceObjects(source) {
|
function removeSupportSpliceObjects(source) {
|
||||||
source = removeSupportProp(source, 'spliceObjects');
|
source = removeSupportProp(source, 'spliceObjects');
|
||||||
|
source = removeSpliceObjectsFix(source);
|
||||||
// remove `support.spliceObjects` fix from the `Array` function mixins
|
|
||||||
source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(!support\.spliceObjects[\s\S]+?(?:{\s*}|\n\1})/, '');
|
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3443,6 +3443,9 @@
|
|||||||
if (!_.contains(buildMethods, otherName) &&
|
if (!_.contains(buildMethods, otherName) &&
|
||||||
!(otherName == 'findWhere' && !isUnderscore)) {
|
!(otherName == 'findWhere' && !isUnderscore)) {
|
||||||
source = removeFunction(source, otherName);
|
source = removeFunction(source, otherName);
|
||||||
|
if (!isNoDep) {
|
||||||
|
source = removeFromCreateIterator(source, otherName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -3536,6 +3539,7 @@
|
|||||||
}
|
}
|
||||||
if (isExcluded('value')) {
|
if (isExcluded('value')) {
|
||||||
source = removeLodashWrapper(source);
|
source = removeLodashWrapper(source);
|
||||||
|
source = removeSpliceObjectsFix(source);
|
||||||
|
|
||||||
// simplify the `lodash` function
|
// simplify the `lodash` function
|
||||||
source = replaceFunction(source, 'lodash', [
|
source = replaceFunction(source, 'lodash', [
|
||||||
|
|||||||
Reference in New Issue
Block a user