mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Add removeNonEnumProps to build.js.
Former-commit-id: d8c544d06fb23d0188c9670b5c0b2cf34e854254
This commit is contained in:
28
build.js
28
build.js
@@ -1445,6 +1445,20 @@
|
|||||||
return source.replace(getMethodAssignments(source), '');
|
return source.replace(getMethodAssignments(source), '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes `nonEnumProps` array assignments from `source`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {String} source The source to process.
|
||||||
|
* @returns {String} Returns the modified source.
|
||||||
|
*/
|
||||||
|
function removeNonEnumProps(source) {
|
||||||
|
// remove nested `nonEnumProps` assignments
|
||||||
|
source = removeVar(source, 'nonEnumProps');
|
||||||
|
source = source.replace(/^ *\(function.+?\n *var length\b[\s\S]+?shadowedProps[\s\S]+?}\(\)\);\n/m, '');
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all pseudo private properties from `source`. If a `propName` is
|
* Removes all pseudo private properties from `source`. If a `propName` is
|
||||||
* specified, only the specified property is removed.
|
* specified, only the specified property is removed.
|
||||||
@@ -1519,7 +1533,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all `support` object references from `source`.
|
* Removes the `support` object declaration from `source`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {String} source The source to process.
|
* @param {String} source The source to process.
|
||||||
@@ -1684,14 +1698,9 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function removeSupportNonEnumShadows(source) {
|
function removeSupportNonEnumShadows(source) {
|
||||||
source = removeSupportProp(source, 'nonEnumShadows');
|
|
||||||
source = removeFromCreateIterator(source, 'shadowedProps');
|
|
||||||
|
|
||||||
source = removeVar(source, 'nonEnumProps');
|
|
||||||
source = removeFromCreateIterator(source, 'nonEnumProps');
|
source = removeFromCreateIterator(source, 'nonEnumProps');
|
||||||
|
source = removeFromCreateIterator(source, 'shadowedProps');
|
||||||
// remove nested `nonEnumProps` assignments
|
source = removeSupportProp(source, 'nonEnumShadows');
|
||||||
source = source.replace(/^ *\(function[\s\S]+?\n *var length\b[\s\S]+?shadowedProps[\s\S]+?}\(\)\);\n/m, '');
|
|
||||||
|
|
||||||
// remove `support.nonEnumShadows` from `iteratorTemplate`
|
// remove `support.nonEnumShadows` from `iteratorTemplate`
|
||||||
source = source.replace(getIteratorTemplate(source), function(match) {
|
source = source.replace(getIteratorTemplate(source), function(match) {
|
||||||
@@ -3506,6 +3515,9 @@
|
|||||||
source = removeVar(source, 'cloneableClasses');
|
source = removeVar(source, 'cloneableClasses');
|
||||||
source = removeVar(source, 'ctorByClass');
|
source = removeVar(source, 'ctorByClass');
|
||||||
}
|
}
|
||||||
|
if (isExcluded('createIterator')) {
|
||||||
|
source = removeNonEnumProps(source);
|
||||||
|
}
|
||||||
if (isExcluded('invert')) {
|
if (isExcluded('invert')) {
|
||||||
source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}");
|
source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user