aboutsummaryrefslogtreecommitdiff
path: root/test/compress/dead-code.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-05-12 14:57:41 +0800
committerGitHub <noreply@github.com>2017-05-12 14:57:41 +0800
commitc391576d52852322a7fcfbaeabc9d5626e628c8b (patch)
treee0f27ac065ec9340bcd5bcd152f8714cf79fdcc9 /test/compress/dead-code.js
parentac73c5d4211b9ecff0f9650a032e964ef1cad585 (diff)
downloadtracifyjs-c391576d52852322a7fcfbaeabc9d5626e628c8b.tar.gz
tracifyjs-c391576d52852322a7fcfbaeabc9d5626e628c8b.zip
remove support for `const` (#1910)
As this is not part of ES5.
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r--test/compress/dead-code.js125
1 files changed, 0 insertions, 125 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index bb72451c..31d0664a 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -90,131 +90,6 @@ dead_code_constant_boolean_should_warn_more: {
expect_stdout: true
}
-dead_code_const_declaration: {
- options = {
- dead_code : true,
- loops : true,
- booleans : true,
- conditionals : true,
- evaluate : true,
- reduce_vars : true,
- };
- input: {
- var unused;
- const CONST_FOO = false;
- if (CONST_FOO) {
- console.log("unreachable");
- var moo;
- function bar() {}
- }
- }
- expect: {
- var unused;
- const CONST_FOO = !1;
- var moo;
- function bar() {}
- }
- expect_stdout: true
-}
-
-dead_code_const_annotation: {
- options = {
- dead_code : true,
- loops : true,
- booleans : true,
- conditionals : true,
- evaluate : true,
- reduce_vars : true,
- toplevel : true,
- };
- input: {
- var unused;
- /** @const */ var CONST_FOO_ANN = false;
- if (CONST_FOO_ANN) {
- console.log("unreachable");
- var moo;
- function bar() {}
- }
- }
- expect: {
- var unused;
- var CONST_FOO_ANN = !1;
- var moo;
- function bar() {}
- }
- expect_stdout: true
-}
-
-dead_code_const_annotation_regex: {
- options = {
- dead_code : true,
- loops : true,
- booleans : true,
- conditionals : true,
- evaluate : true
- };
- input: {
- var unused;
- // @constraint this shouldn't be a constant
- var CONST_FOO_ANN = false;
- if (CONST_FOO_ANN) {
- console.log("reachable");
- }
- }
- expect: {
- var unused;
- var CONST_FOO_ANN = !1;
- CONST_FOO_ANN && console.log('reachable');
- }
- expect_stdout: true
-}
-
-dead_code_const_annotation_complex_scope: {
- options = {
- dead_code : true,
- loops : true,
- booleans : true,
- conditionals : true,
- evaluate : true,
- reduce_vars : true,
- toplevel : true,
- };
- input: {
- var unused_var;
- /** @const */ var test = 'test';
- // @const
- var CONST_FOO_ANN = false;
- var unused_var_2;
- if (CONST_FOO_ANN) {
- console.log("unreachable");
- var moo;
- function bar() {}
- }
- if (test === 'test') {
- var beef = 'good';
- /** @const */ var meat = 'beef';
- var pork = 'bad';
- if (meat === 'pork') {
- console.log('also unreachable');
- } else if (pork === 'good') {
- console.log('reached, not const');
- }
- }
- }
- expect: {
- var unused_var;
- var test = 'test';
- var CONST_FOO_ANN = !1;
- var unused_var_2;
- var moo;
- function bar() {}
- var beef = 'good';
- var meat = 'beef';
- var pork = 'bad';
- }
- expect_stdout: true
-}
-
try_catch_finally: {
options = {
conditionals: true,