From c8a71e279e5fa1a34798ca680341543d4e50b7ad Mon Sep 17 00:00:00 2001 From: "Ashley (Scirra)" Date: Tue, 11 Oct 2016 13:17:40 +0100 Subject: [PATCH] Style updates Update style and remove some commented code --- lib/propmangle.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/propmangle.js b/lib/propmangle.js index a98cd8bb..52705393 100644 --- a/lib/propmangle.js +++ b/lib/propmangle.js @@ -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;