aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-16 06:37:40 +0800
committerGitHub <noreply@github.com>2019-10-16 06:37:40 +0800
commit8ff9a3c8fb89ac40fea0dd1cd249e8b94a690c2e (patch)
tree3df4e52f16431d13fc2a81f8c45ba5d7ac1820bd /test
parent91cae51d8f8a7f06e55dba7d100bbb663448875b (diff)
downloadtracifyjs-8ff9a3c8fb89ac40fea0dd1cd249e8b94a690c2e.tar.gz
tracifyjs-8ff9a3c8fb89ac40fea0dd1cd249e8b94a690c2e.zip
fix corner cases in `ie8` (#3485)
fixes #3484
Diffstat (limited to 'test')
-rw-r--r--test/compress/ie8.js158
1 files changed, 158 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index e57c233e..c6b51d63 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -1683,3 +1683,161 @@ issue_3482_2_ie8: {
}
expect_stdout: "NaN NaN NaN"
}
+
+issue_3484_1: {
+ options = {
+ ie8: false,
+ side_effects: true,
+ toplevel: false,
+ }
+ input: {
+ (function f() {})();
+ console.log(typeof f);
+ }
+ expect: {
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+}
+
+issue_3484_1_ie8: {
+ options = {
+ ie8: true,
+ side_effects: true,
+ toplevel: false,
+ }
+ input: {
+ (function f() {})();
+ // IE8: function
+ console.log(typeof f);
+ }
+ expect: {
+ (function f() {})();
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+}
+
+issue_3484_1_toplevel: {
+ options = {
+ ie8: false,
+ side_effects: true,
+ toplevel: true,
+ }
+ input: {
+ (function f() {})();
+ console.log(typeof f);
+ }
+ expect: {
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+}
+
+issue_3484_1_ie8_toplevel: {
+ options = {
+ ie8: true,
+ side_effects: true,
+ toplevel: true,
+ }
+ input: {
+ (function f() {})();
+ // IE8: function
+ console.log(typeof f);
+ }
+ expect: {
+ (function f() {})();
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+}
+
+issue_3484_2: {
+ options = {
+ evaluate: true,
+ ie8: false,
+ reduce_vars: true,
+ toplevel: false,
+ }
+ input: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log(typeof (1 / 0), typeof Infinity);
+ }
+ expect: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log("number", "number");
+ }
+ expect_stdout: "number number"
+}
+
+issue_3484_2_ie8: {
+ options = {
+ evaluate: true,
+ ie8: true,
+ reduce_vars: true,
+ toplevel: false,
+ }
+ input: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ // IE8: number function
+ console.log(typeof (1 / 0), typeof Infinity);
+ }
+ expect: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log("number", typeof Infinity);
+ }
+ expect_stdout: "number number"
+}
+
+issue_3484_2_toplevel: {
+ options = {
+ evaluate: true,
+ ie8: false,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log(typeof (1 / 0), typeof Infinity);
+ }
+ expect: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log("number", "number");
+ }
+ expect_stdout: "number number"
+}
+
+issue_3484_2_ie8_toplevel: {
+ options = {
+ evaluate: true,
+ ie8: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ // IE8: number function
+ console.log(typeof (1 / 0), typeof Infinity);
+ }
+ expect: {
+ (function Infinity() {
+ var Infinity;
+ })();
+ console.log("number", typeof Infinity);
+ }
+ expect_stdout: "number number"
+}