mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Make removeVar punt to removeSupport when removing the support variable.
Former-commit-id: 8a961673173f60669282a7ebb9ad142e13af078e
This commit is contained in:
8
build.js
8
build.js
@@ -1756,9 +1756,13 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function removeVar(source, varName) {
|
function removeVar(source, varName) {
|
||||||
|
// defer to specialized removal functions
|
||||||
|
if (varName == 'support') {
|
||||||
|
return removeSupport(source);
|
||||||
|
}
|
||||||
// simplify complex variable assignments
|
// simplify complex variable assignments
|
||||||
if (/^(?:cloneableClasses|contextProps|ctorByClass|freeGlobal|nonEnumProps|shadowedProps|whitespace)$/.test(varName)) {
|
if (/^(?:cloneableClasses|contextProps|ctorByClass|freeGlobal|nonEnumProps|shadowedProps|whitespace)$/.test(varName)) {
|
||||||
source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?[;}]\\n\\n'), '$1 null;\n\n');
|
source = source.replace(RegExp('(var ' + varName + ') *=[\\s\\S]+?[;}]\\n\\n'), '$1 = null;\n\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
source = removeFunction(source, varName);
|
source = removeFunction(source, varName);
|
||||||
@@ -3535,8 +3539,8 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// remove all horizontal rule comment separators
|
||||||
source = source.replace(/^ *\/\*-+\*\/\n/gm, '');
|
source = source.replace(/^ *\/\*-+\*\/\n/gm, '');
|
||||||
source = removeSupport(source);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isExcluded('bind')) {
|
if (isExcluded('bind')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user