From c4eaf083b4a59215cd3e83c0363829aed7e42548 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Tue, 13 Mar 2012 20:29:38 +0000 Subject: [PATCH] Code formatting. Don't shadow compressor function name. --- Objective-J/CommonJS/lib/objective-j/compiler.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Objective-J/CommonJS/lib/objective-j/compiler.js b/Objective-J/CommonJS/lib/objective-j/compiler.js index 1aafec3b4..b55264689 100644 --- a/Objective-J/CommonJS/lib/objective-j/compiler.js +++ b/Objective-J/CommonJS/lib/objective-j/compiler.js @@ -14,13 +14,16 @@ var compressors = { //,yui : { id : "minify/yuicompressor" } // ,cc : { id : "minify/closure-compiler" } }; + var compressorStats = {}; -function compressor(code) { +function compressor(code) +{ var winner, winnerName; compressorStats['original'] = (compressorStats['original'] || 0) + code.length; - for (var name in compressors) { - var compressor = require(compressors[name].id); - var result = compressor.compress(code, { charset : "UTF-8", useServer : true }); + for (var name in compressors) + { + var aCompressor = require(compressors[name].id), + result = aCompressor.compress(code, { charset : "UTF-8", useServer : true }); compressorStats[name] = (compressorStats[name] || 0) + result.length; if (!winner || result < winner.length) { winner = result;