aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-08-27 11:00:26 +0300
committerMihai Bazon <mihai@bazon.net>2012-08-27 11:00:26 +0300
commit8dfa9fe7e58c742b7835523daa423b12ada2718c (patch)
tree9ab9c59a530a200c5a3fce9ff1041b7cc1943d55 /test
parent4437e7af1931f995686511938ad80f704ef5925e (diff)
downloadtracifyjs-8dfa9fe7e58c742b7835523daa423b12ada2718c.tar.gz
tracifyjs-8dfa9fe7e58c742b7835523daa423b12ada2718c.zip
minor
Diffstat (limited to 'test')
-rw-r--r--test/compress/blocks.js2
-rw-r--r--test/compress/dead-code.js8
-rwxr-xr-xtest/run-tests.js4
3 files changed, 10 insertions, 4 deletions
diff --git a/test/compress/blocks.js b/test/compress/blocks.js
index 027b5d64..8372adf2 100644
--- a/test/compress/blocks.js
+++ b/test/compress/blocks.js
@@ -20,7 +20,7 @@ keep_some_blocks: {
// 1.
if (foo) {
{{{}}}
- if (bar) baz();
+ if (bar) { baz(); }
{{}}
} else {
stuff();
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index bb955569..e84b4011 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -33,11 +33,17 @@ dead_code_2_should_warn: {
x = 10;
throw "foo";
// completely discarding the `if` would introduce some
- // bugs. UglifyJS v1 doesn't deal with this issue.
+ // bugs. UglifyJS v1 doesn't deal with this issue; in v2
+ // we copy any declarations to the upper scope.
if (x) {
y();
var x;
function g(){};
+ // but nested declarations should not be kept.
+ (function(){
+ var q;
+ function y(){};
+ })();
}
}
}
diff --git a/test/run-tests.js b/test/run-tests.js
index b6e8ee2b..52018329 100755
--- a/test/run-tests.js
+++ b/test/run-tests.js
@@ -22,11 +22,11 @@ function log() {
}
function log_directory(dir) {
- log("--- Entering [{dir}]", { dir: dir });
+ log("*** Entering [{dir}]", { dir: dir });
}
function log_start_file(file) {
- log("*** {file}", { file: file });
+ log("--- {file}", { file: file });
}
function log_test(name) {