mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +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), '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
* @param {String} source The source to process.
|
||||
@@ -1684,14 +1698,9 @@
|
||||
* @returns {String} Returns the modified source.
|
||||
*/
|
||||
function removeSupportNonEnumShadows(source) {
|
||||
source = removeSupportProp(source, 'nonEnumShadows');
|
||||
source = removeFromCreateIterator(source, 'shadowedProps');
|
||||
|
||||
source = removeVar(source, 'nonEnumProps');
|
||||
source = removeFromCreateIterator(source, 'nonEnumProps');
|
||||
|
||||
// remove nested `nonEnumProps` assignments
|
||||
source = source.replace(/^ *\(function[\s\S]+?\n *var length\b[\s\S]+?shadowedProps[\s\S]+?}\(\)\);\n/m, '');
|
||||
source = removeFromCreateIterator(source, 'shadowedProps');
|
||||
source = removeSupportProp(source, 'nonEnumShadows');
|
||||
|
||||
// remove `support.nonEnumShadows` from `iteratorTemplate`
|
||||
source = source.replace(getIteratorTemplate(source), function(match) {
|
||||
@@ -3506,6 +3515,9 @@
|
||||
source = removeVar(source, 'cloneableClasses');
|
||||
source = removeVar(source, 'ctorByClass');
|
||||
}
|
||||
if (isExcluded('createIterator')) {
|
||||
source = removeNonEnumProps(source);
|
||||
}
|
||||
if (isExcluded('invert')) {
|
||||
source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user