play nice with propmangle

This commit is contained in:
Fábio Santos
2015-08-08 16:01:16 +01:00
parent dc5db9b6ca
commit 7ee8f3512e
3 changed files with 15 additions and 2 deletions

View File

@@ -90,6 +90,9 @@ function mangle_properties(ast, options) {
if (node instanceof AST_ObjectKeyVal) {
add(node.key);
}
else if (node instanceof AST_ObjectSymbol) {
add(node.symbol.name);
}
else if (node instanceof AST_ObjectProperty) {
// setter or getter, since KeyVal is handled above
add(node.key.name);
@@ -111,6 +114,11 @@ function mangle_properties(ast, options) {
if (node instanceof AST_ObjectKeyVal) {
node.key = mangle(node.key);
}
else if (node instanceof AST_ObjectSymbol) {
if (should_mangle(node.symbol.name)) {
node.mangled_key = mangle(node.symbol.name)
}
}
else if (node instanceof AST_ObjectProperty) {
// setter or getter
node.key.name = mangle(node.key.name);