aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-09-05 18:19:30 +0300
committerMihai Bazon <mihai@bazon.net>2012-09-05 18:19:30 +0300
commit9bb1a84d6bef8fa95d025d65bd0c2772bceca404 (patch)
tree069f26d2dadbb53a9d2cc4342b0e560295c01973
parent0afafe64fcbaf720889b8906a91dafb6dc409cdd (diff)
downloadtracifyjs-9bb1a84d6bef8fa95d025d65bd0c2772bceca404.tar.gz
tracifyjs-9bb1a84d6bef8fa95d025d65bd0c2772bceca404.zip
don't duplicate argument names
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3d2f5404..d8def866 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -521,7 +521,10 @@ function Compressor(options, false_by_default) {
if (vars_found > 0) {
if (self instanceof AST_Lambda && !self.uses_arguments) {
for (var i in vars) if (HOP(vars, i)) {
- self.argnames.push(vars[i].name);
+ var sym = vars[i].name;
+ if (!find_if(function(arg){ return arg.name == sym.name }, self.argnames)) {
+ self.argnames.push(sym);
+ }
}
} else {
var node = make_node(AST_Var, self, {