aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-09-26 19:52:32 +0300
committerMihai Bazon <mihai@bazon.net>2012-09-26 19:52:32 +0300
commit13278c6649189ffea363ac51be5f6b9738e04ff7 (patch)
tree7741a08ca14adeb70d50f8ab32225da52cd3d872
parent15d58f5917cba980754553a1578c9d339cc7b419 (diff)
downloadtracifyjs-13278c6649189ffea363ac51be5f6b9738e04ff7.tar.gz
tracifyjs-13278c6649189ffea363ac51be5f6b9738e04ff7.zip
removed the "squeeze" method (it's now effectively "transform")
-rwxr-xr-xbin/uglifyjs22
-rw-r--r--lib/compress.js18
-rwxr-xr-xtest/run-tests.js2
3 files changed, 8 insertions, 14 deletions
diff --git a/bin/uglifyjs2 b/bin/uglifyjs2
index d8745d7a..daf17573 100755
--- a/bin/uglifyjs2
+++ b/bin/uglifyjs2
@@ -132,7 +132,7 @@ if (SCOPE_IS_NEEDED) {
if (ARGS.c !== true) {
time_it("squeeze", function(){
var compressor = UglifyJS.Compressor(COMPRESSOR_OPTIONS);
- TOPLEVEL = TOPLEVEL.squeeze(compressor);
+ TOPLEVEL = TOPLEVEL.transform(compressor);
});
}
diff --git a/lib/compress.js b/lib/compress.js
index 6870fa6e..3054e1fe 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -214,7 +214,7 @@ merge(Compressor.prototype, {
CHANGED = true;
stat = stat.clone();
stat.alternative = ret[0];
- ret[0] = stat.squeeze(compressor);
+ ret[0] = stat.transform(compressor);
continue loop;
}
//---
@@ -225,7 +225,7 @@ merge(Compressor.prototype, {
stat.alternative = ret[0] || make_node(AST_Return, stat, {
value: make_node(AST_Undefined, stat)
});
- ret[0] = stat.squeeze(compressor);
+ ret[0] = stat.transform(compressor);
continue loop;
}
//---
@@ -238,7 +238,7 @@ merge(Compressor.prototype, {
body: as_statement_array(stat.alternative).concat(ret)
});
stat.alternative = null;
- ret = [ stat.squeeze(compressor) ];
+ ret = [ stat.transform(compressor) ];
continue loop;
}
//---
@@ -247,7 +247,7 @@ merge(Compressor.prototype, {
CHANGED = true;
ret.push(make_node(AST_Return, ret[0], {
value: make_node(AST_Undefined, ret[0])
- }).squeeze(compressor));
+ }).transform(compressor));
ret = as_statement_array(stat.alternative).concat(ret);
ret.unshift(stat);
continue loop;
@@ -267,7 +267,7 @@ merge(Compressor.prototype, {
stat.alternative = make_node(AST_BlockStatement, stat, {
body: body
});
- ret = [ stat.squeeze(compressor) ];
+ ret = [ stat.transform(compressor) ];
continue loop;
}
@@ -282,7 +282,7 @@ merge(Compressor.prototype, {
stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
body: as_statement_array(stat.alternative).slice(0, -1)
});
- ret = [ stat.squeeze(compressor) ];
+ ret = [ stat.transform(compressor) ];
continue loop;
}
@@ -1543,10 +1543,4 @@ merge(Compressor.prototype, {
return self;
});
- /* -----[ node squeezers ]----- */
-
- AST_Node.DEFMETHOD("squeeze", function(compressor){
- return this.transform(compressor);
- });
-
})();
diff --git a/test/run-tests.js b/test/run-tests.js
index 32b6c423..8822f2a5 100755
--- a/test/run-tests.js
+++ b/test/run-tests.js
@@ -64,7 +64,7 @@ function run_compress_tests() {
var cmp = new U.Compressor(test.options || {}, true);
var expect = make_code(as_toplevel(test.expect), false);
var input = as_toplevel(test.input);
- var output = input.squeeze(cmp);
+ var output = input.transform(cmp);
output.figure_out_scope();
output = make_code(output, false);
if (expect != output) {