mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 12:27:49 +00:00
Remove pseudo private properties from debug builds.
Former-commit-id: 839c2e47e19ba163f0c69d3c115ec9ee262d5d6b
This commit is contained in:
6
build.js
6
build.js
@@ -1082,6 +1082,9 @@
|
|||||||
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasObjectSpliceBug;|.+?hasObjectSpliceBug *=.+/g, '');
|
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasObjectSpliceBug;|.+?hasObjectSpliceBug *=.+/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove pseudo private properties
|
||||||
|
source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
|
||||||
|
|
||||||
// assign debug source before further modifications that rely on the minifier
|
// assign debug source before further modifications that rely on the minifier
|
||||||
// to remove unused variables and other dead code
|
// to remove unused variables and other dead code
|
||||||
debugSource = source;
|
debugSource = source;
|
||||||
@@ -1136,9 +1139,6 @@
|
|||||||
source = source.replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);/, '');
|
source = source.replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove pseudo private properties
|
|
||||||
source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
|
|
||||||
|
|
||||||
// consolidate consecutive horizontal rule comment separators
|
// consolidate consecutive horizontal rule comment separators
|
||||||
source = source.replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) {
|
source = source.replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) {
|
||||||
return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*'));
|
return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*'));
|
||||||
|
|||||||
Reference in New Issue
Block a user