Style updates
Update style and remove some commented code
This commit is contained in:
parent
58459d0e60
commit
c8a71e279e
|
|
@ -84,7 +84,7 @@ function mangle_properties(ast, options) {
|
|||
only_cache : false,
|
||||
regex : null,
|
||||
ignore_quoted : false,
|
||||
treat_as_global : []
|
||||
treat_as_global : [],
|
||||
});
|
||||
|
||||
var reserved = options.reserved;
|
||||
|
|
@ -116,10 +116,6 @@ function mangle_properties(ast, options) {
|
|||
return treat_as_global.indexOf(name) >= 0;
|
||||
}
|
||||
|
||||
// TODO: don't know if this is necessary to get scope information?
|
||||
//if (mangle_globals)
|
||||
// ast.figure_out_scope();
|
||||
|
||||
// step 1: find candidates to mangle
|
||||
ast.walk(new TreeWalker(function(node){
|
||||
if (node instanceof AST_ObjectKeyVal) {
|
||||
|
|
@ -138,8 +134,7 @@ function mangle_properties(ast, options) {
|
|||
node.expression instanceof AST_SymbolRef &&
|
||||
node.expression.global() &&
|
||||
is_global_alias(node.expression.name) &&
|
||||
!is_global_alias(node.property))
|
||||
{
|
||||
!is_global_alias(node.property)) {
|
||||
cache.global_defs[node.property] = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -154,8 +149,7 @@ function mangle_properties(ast, options) {
|
|||
// be a local variable in scope), also treat it as a global definition.
|
||||
if (mangle_globals &&
|
||||
node.global() &&
|
||||
!is_global_alias(node.name))
|
||||
{
|
||||
!is_global_alias(node.name)) {
|
||||
cache.global_defs[node.name] = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -188,8 +182,7 @@ function mangle_properties(ast, options) {
|
|||
// and it's on our list of global definitions, then mangle it.
|
||||
if (mangle_globals &&
|
||||
node.global() &&
|
||||
node.name in cache.global_defs)
|
||||
{
|
||||
node.name in cache.global_defs) {
|
||||
var mangled_name = mangle(node.name);
|
||||
node.name = mangled_name;
|
||||
node.definition().mangled_name = mangled_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user