mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Remove nonEnumProps from the modernish builds.
Former-commit-id: 38592e1ee24524b223b801ede8033d7b4ccb8a36
This commit is contained in:
6
build.js
6
build.js
@@ -1228,9 +1228,13 @@
|
|||||||
*/
|
*/
|
||||||
function removeSupportNonEnumShadows(source) {
|
function removeSupportNonEnumShadows(source) {
|
||||||
source = removeSupportProp(source, 'nonEnumShadows');
|
source = removeSupportProp(source, 'nonEnumShadows');
|
||||||
|
source = removeVar(source, 'nonEnumProps');
|
||||||
source = removeVar(source, 'shadowedProps');
|
source = removeVar(source, 'shadowedProps');
|
||||||
source = removeFromCreateIterator(source, 'shadowedProps');
|
source = removeFromCreateIterator(source, 'shadowedProps');
|
||||||
|
|
||||||
|
// remove nested `nonEnumProps` assignments
|
||||||
|
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) {
|
||||||
return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(support\.nonEnumShadows[\s\S]+?["']\1<% *} *%>.+/, '');
|
return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(support\.nonEnumShadows[\s\S]+?["']\1<% *} *%>.+/, '');
|
||||||
@@ -1382,7 +1386,7 @@
|
|||||||
*/
|
*/
|
||||||
function removeVar(source, varName) {
|
function removeVar(source, varName) {
|
||||||
// simplify complex variable assignments
|
// simplify complex variable assignments
|
||||||
if (/^(?:cloneableClasses|contextProps|ctorByClass|shadowedProps|whitespace)$/.test(varName)) {
|
if (/^(?:cloneableClasses|contextProps|ctorByClass|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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user