finish minification.removeConsoleCall transformer #740
This commit is contained in:
parent
825d84ba52
commit
6266f5b924
@ -6,8 +6,12 @@ var isConsole = t.buildMatchMemberExpression("console", true);
|
||||
|
||||
exports.optional = true;
|
||||
|
||||
exports.CallExpression = function (node) {
|
||||
exports.CallExpression = function (node, parent) {
|
||||
if (isConsole(node.callee)) {
|
||||
this.remove();
|
||||
if (t.isExpressionStatement(parent)) {
|
||||
this.parentPath.remove();
|
||||
} else {
|
||||
this.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -444,12 +444,8 @@ t.buildMatchMemberExpression = function (match, allowPartial) {
|
||||
}
|
||||
|
||||
// too many parts
|
||||
if (++i > parts.length) {
|
||||
if (allowPartial) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (++i >= parts.length) {
|
||||
return !!allowPartial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user