aboutsummaryrefslogtreecommitdiff
path: root/test/compress/dead-code.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-04 18:45:51 +0800
committerGitHub <noreply@github.com>2018-01-04 18:45:51 +0800
commita6873a38590a9176c607bcdbff726daa93e1fec7 (patch)
treea23ff4a6df34716529d7d62b70289284c9e1f411 /test/compress/dead-code.js
parent7a6d452b548c8b7783b226f646e814d6cb0cf32b (diff)
downloadtracifyjs-a6873a38590a9176c607bcdbff726daa93e1fec7.tar.gz
tracifyjs-a6873a38590a9176c607bcdbff726daa93e1fec7.zip
forbid block-scoped `AST_Defun` in strict mode (#2718)
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r--test/compress/dead-code.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 32bb88e6..490cff7a 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -62,46 +62,6 @@ dead_code_2_should_warn: {
node_version: "<=4"
}
-dead_code_2_should_warn_strict: {
- options = {
- dead_code: true
- };
- input: {
- "use strict";
- function f() {
- g();
- x = 10;
- throw new Error("foo");
- // completely discarding the `if` would introduce some
- // 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(){};
- })();
- }
- }
- f();
- }
- expect: {
- "use strict";
- function f() {
- g();
- x = 10;
- throw new Error("foo");
- var x;
- }
- f();
- }
- expect_stdout: true
- node_version: ">=4"
-}
-
dead_code_constant_boolean_should_warn_more: {
options = {
dead_code : true,
@@ -137,42 +97,6 @@ dead_code_constant_boolean_should_warn_more: {
node_version: "<=4"
}
-dead_code_constant_boolean_should_warn_more_strict: {
- options = {
- dead_code : true,
- loops : true,
- booleans : true,
- conditionals : true,
- evaluate : true,
- side_effects : true,
- };
- input: {
- "use strict";
- while (!((foo && bar) || (x + "0"))) {
- console.log("unreachable");
- var foo;
- function bar() {}
- }
- for (var x = 10, y; x && (y || x) && (!typeof x); ++x) {
- asdf();
- foo();
- var moo;
- }
- bar();
- }
- expect: {
- "use strict";
- var foo;
- // nothing for the while
- // as for the for, it should keep:
- var moo;
- var x = 10, y;
- bar();
- }
- expect_stdout: true
- node_version: ">=4"
-}
-
try_catch_finally: {
options = {
conditionals: true,