Make concise methods work with propmangle

This commit is contained in:
Fábio Santos
2015-10-26 22:15:21 +00:00
committed by Richard van Velzen
parent 34213ea2f8
commit c99eaae360
2 changed files with 28 additions and 0 deletions

View File

@@ -107,6 +107,9 @@ function mangle_properties(ast, options) {
addStrings(node.property);
}
}
else if (node instanceof AST_ConciseMethod) {
add(node.name.name);
}
}));
// step 2: transform the tree, renaming properties
@@ -129,6 +132,11 @@ function mangle_properties(ast, options) {
else if (node instanceof AST_Sub) {
node.property = mangleStrings(node.property);
}
else if (node instanceof AST_ConciseMethod) {
if (should_mangle(node.name.name)) {
node.name.name = mangle(node.name.name);
}
}
// else if (node instanceof AST_String) {
// if (should_mangle(node.value)) {
// AST_Node.warn(