aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-07-19 14:45:36 +0800
committerGitHub <noreply@github.com>2018-07-19 14:45:36 +0800
commitcea685f8d98ad198f3a99d8a217183d15650959d (patch)
tree1e753254934442c5c17a49593e42b1b188726489 /test/compress/collapse_vars.js
parent8d4b5344f4f1d834860c407b2760fe091dedacd9 (diff)
downloadtracifyjs-cea685f8d98ad198f3a99d8a217183d15650959d.tar.gz
tracifyjs-cea685f8d98ad198f3a99d8a217183d15650959d.zip
fix corner case in `ie8` (#3216)
fixes #3215
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js97
1 files changed, 97 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 15d8243c..31eb2383 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -5730,3 +5730,100 @@ issue_3096: {
}
expect_stdout: "ab"
}
+
+issue_3215_1: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ ie8: false,
+ inline: true,
+ passes: 2,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ console.log(function a() {
+ var a = 42;
+ return typeof a;
+ }());
+ }
+ expect: {
+ console.log("number");
+ }
+ expect_stdout: "number"
+}
+
+issue_3215_2: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ ie8: true,
+ inline: true,
+ passes: 2,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ console.log(function a() {
+ var a = 42;
+ return typeof a;
+ }());
+ }
+ expect: {
+ console.log(function a() {
+ var a = 42;
+ return typeof a;
+ }());
+ }
+ expect_stdout: "number"
+}
+
+issue_3215_3: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ ie8: false,
+ inline: true,
+ passes: 2,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ var a = 42;
+ (function a() {});
+ return typeof a;
+ }());
+ }
+ expect: {
+ console.log("number");
+ }
+ expect_stdout: "number"
+}
+
+issue_3215_4: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ ie8: true,
+ inline: true,
+ passes: 2,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ var a = 42;
+ (function a() {});
+ return typeof a;
+ }());
+ }
+ expect: {
+ console.log(function() {
+ var a = 42;
+ (function a() {});
+ return typeof a;
+ }());
+ }
+ expect_stdout: "number"
+}