aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-04-01 15:22:00 +0800
committerGitHub <noreply@github.com>2019-04-01 15:22:00 +0800
commita74e600fa09895ce972343b1b96558787398058a (patch)
tree1cd06ca56ea6f1fe15d1e81c27d8e5857a6b502c /test/compress
parent4b21526310ebb9a953020c347d1732d2e87b3cf2 (diff)
downloadtracifyjs-a74e600fa09895ce972343b1b96558787398058a.tar.gz
tracifyjs-a74e600fa09895ce972343b1b96558787398058a.zip
mangle shadowed lambda under `ie8` correctly (#3356)
fixes #3355
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/ie8.js108
1 files changed, 108 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index dd9bae47..f98033e0 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -861,3 +861,111 @@ issue_3215_4: {
}
expect_stdout: "PASS"
}
+
+issue_3355_1: {
+ mangle = {
+ ie8: false,
+ }
+ input: {
+ (function f() {
+ var f;
+ })();
+ (function g() {
+ })();
+ console.log(typeof f === typeof g);
+ }
+ expect: {
+ (function o() {
+ var o;
+ })();
+ (function o() {
+ })();
+ console.log(typeof f === typeof g);
+ }
+ expect_stdout: "true"
+}
+
+issue_3355_2: {
+ mangle = {
+ ie8: true,
+ }
+ input: {
+ (function f() {
+ var f;
+ })();
+ (function g() {
+ })();
+ console.log(typeof f === typeof g);
+ }
+ expect: {
+ (function f() {
+ var f;
+ })();
+ (function g() {
+ })();
+ console.log(typeof f === typeof g);
+ }
+ expect_stdout: "true"
+}
+
+issue_3355_3: {
+ mangle = {
+ ie8: false,
+ }
+ input: {
+ !function(a) {
+ "aaaaaaaaaa";
+ a();
+ var b = function c() {
+ var c = 42;
+ console.log("FAIL");
+ };
+ }(function() {
+ console.log("PASS");
+ });
+ }
+ expect: {
+ !function(a) {
+ "aaaaaaaaaa";
+ a();
+ var o = function a() {
+ var a = 42;
+ console.log("FAIL");
+ };
+ }(function() {
+ console.log("PASS");
+ });
+ }
+ expect_stdout: "PASS"
+}
+
+issue_3355_4: {
+ mangle = {
+ ie8: true,
+ }
+ input: {
+ !function(a) {
+ "aaaaaaaaaa";
+ a();
+ var b = function c() {
+ var c = 42;
+ console.log("FAIL");
+ };
+ }(function() {
+ console.log("PASS");
+ });
+ }
+ expect: {
+ !function(a) {
+ "aaaaaaaaaa";
+ a();
+ var o = function n() {
+ var n = 42;
+ console.log("FAIL");
+ };
+ }(function() {
+ console.log("PASS");
+ });
+ }
+ expect_stdout: "PASS"
+}