diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-30 06:32:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 06:32:24 +0800 |
commit | 2ea96549c55c44935c05fcaf6c68119d0eef4c8e (patch) | |
tree | 89a3ab9e15c3b250858f9d1c590816675cf93c5f /test/compress | |
parent | fba008e2989de0611d144a1ec91d9eb1c9b2b479 (diff) | |
download | tracifyjs-2ea96549c55c44935c05fcaf6c68119d0eef4c8e.tar.gz tracifyjs-2ea96549c55c44935c05fcaf6c68119d0eef4c8e.zip |
unify logging functionality (#3392)
fixes #3253
fixes #3254
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 4 | ||||
-rw-r--r-- | test/compress/drop-unused.js | 12 | ||||
-rw-r--r-- | test/compress/ie8.js | 20 | ||||
-rw-r--r-- | test/compress/issue-1034.js | 18 |
4 files changed, 26 insertions, 28 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 470f3b76..6e0afc6e 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -4194,7 +4194,7 @@ may_throw_2: { var a = x(); ++b; return b(a); - } catch(e) {} + } catch (e) {} console.log(b); } f(0); @@ -4204,7 +4204,7 @@ may_throw_2: { try { var a = x(); return (++b)(a); - } catch(e) {} + } catch (e) {} console.log(b); } f(0); diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index 74fe3693..9286532b 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -144,7 +144,7 @@ unused_var_in_catch: { function foo() { try { foo(); - } catch(ex) { + } catch (ex) { var x = 10; } } @@ -153,7 +153,7 @@ unused_var_in_catch: { function foo() { try { foo(); - } catch(ex) {} + } catch (ex) {} } } } @@ -166,7 +166,7 @@ used_var_in_catch: { function foo() { try { foo(); - } catch(ex) { + } catch (ex) { var x = 10; } return x; @@ -176,7 +176,7 @@ used_var_in_catch: { function foo() { try { foo(); - } catch(ex) { + } catch (ex) { var x = 10; } return x; @@ -1156,7 +1156,7 @@ var_catch_toplevel: { try { a++; x(); - } catch(a) { + } catch (a) { if (a) var a; var a = 10; } @@ -1167,7 +1167,7 @@ var_catch_toplevel: { !function() { try { x(); - } catch(a) { + } catch (a) { var a; } }(); diff --git a/test/compress/ie8.js b/test/compress/ie8.js index f98033e0..e81e1a01 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -59,9 +59,9 @@ do_screw_try_catch: { input: { good = function(e){ return function(error){ - try{ + try { e() - } catch(e) { + } catch (e) { error(e) } } @@ -70,9 +70,9 @@ do_screw_try_catch: { expect: { good = function(n){ return function(t){ - try{ + try { n() - } catch(n) { + } catch (n) { t(n) } } @@ -93,9 +93,9 @@ dont_screw_try_catch: { input: { bad = function(e){ return function(error){ - try{ + try { e() - } catch(e) { + } catch (e) { error(e) } } @@ -104,9 +104,9 @@ dont_screw_try_catch: { expect: { bad = function(t){ return function(n){ - try{ + try { t() - } catch(t) { + } catch (t) { n(t) } } @@ -137,7 +137,7 @@ do_screw_try_catch_undefined: { } expect: { function a(o){ - try{ + try { throw "Stuff" } catch (o) { console.log("caught: "+o) @@ -172,7 +172,7 @@ dont_screw_try_catch_undefined: { } expect: { function a(n){ - try{ + try { throw "Stuff" } catch (undefined) { console.log("caught: " + undefined) diff --git a/test/compress/issue-1034.js b/test/compress/issue-1034.js index f2a89e33..e8b69187 100644 --- a/test/compress/issue-1034.js +++ b/test/compress/issue-1034.js @@ -59,7 +59,6 @@ non_hoisted_function_after_return_2a: { passes: 2, side_effects: true, unused: true, - warnings: "verbose", } input: { function foo(x) { @@ -91,13 +90,13 @@ non_hoisted_function_after_return_2a: { "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:7,16]", "WARN: Dropping unused variable a [test/compress/issue-1034.js:4,20]", "WARN: Dropping unused function nope [test/compress/issue-1034.js:11,21]", - "WARN: pass 0: last_count: Infinity, count: 37", + "INFO: pass 0: last_count: Infinity, count: 37", "WARN: Dropping unreachable code [test/compress/issue-1034.js:9,12]", "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:9,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:12,12]", - "WARN: Dropping unused variable b [test/compress/issue-1034.js:7,20]", - "WARN: Dropping unused variable c [test/compress/issue-1034.js:9,16]", - "WARN: pass 1: last_count: 37, count: 18", + "INFO: Dropping unused variable b [test/compress/issue-1034.js:7,20]", + "INFO: Dropping unused variable c [test/compress/issue-1034.js:9,16]", + "INFO: pass 1: last_count: 37, count: 18", ] } @@ -213,7 +212,6 @@ non_hoisted_function_after_return_2a_strict: { passes: 2, side_effects: true, unused: true, - warnings: "verbose", } input: { "use strict"; @@ -250,13 +248,13 @@ non_hoisted_function_after_return_2a_strict: { "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:8,16]", "WARN: Dropping unused variable a [test/compress/issue-1034.js:5,20]", "WARN: Dropping unused function nope [test/compress/issue-1034.js:12,21]", - "WARN: pass 0: last_count: Infinity, count: 48", + "INFO: pass 0: last_count: Infinity, count: 48", "WARN: Dropping unreachable code [test/compress/issue-1034.js:10,12]", "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:10,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:13,12]", - "WARN: Dropping unused variable b [test/compress/issue-1034.js:8,20]", - "WARN: Dropping unused variable c [test/compress/issue-1034.js:10,16]", - "WARN: pass 1: last_count: 48, count: 29", + "INFO: Dropping unused variable b [test/compress/issue-1034.js:8,20]", + "INFO: Dropping unused variable c [test/compress/issue-1034.js:10,16]", + "INFO: pass 1: last_count: 48, count: 29", ] } |