aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-597.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/issue-597.js')
-rw-r--r--test/compress/issue-597.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/compress/issue-597.js b/test/compress/issue-597.js
index 987bcacc..143fcc22 100644
--- a/test/compress/issue-597.js
+++ b/test/compress/issue-597.js
@@ -6,7 +6,7 @@ NaN_and_Infinity_must_have_parens: {
}
expect: {
(1/0).toString();
- (0/0).toString();
+ NaN.toString();
}
}
@@ -24,6 +24,36 @@ NaN_and_Infinity_should_not_be_replaced_when_they_are_redefined: {
}
}
+NaN_and_Infinity_must_have_parens_evaluate: {
+ options = {
+ evaluate: true,
+ }
+ input: {
+ (123456789 / 0).toString();
+ (+"foo").toString();
+ }
+ expect: {
+ (1/0).toString();
+ NaN.toString();
+ }
+}
+
+NaN_and_Infinity_should_not_be_replaced_when_they_are_redefined_evaluate: {
+ options = {
+ evaluate: true,
+ }
+ input: {
+ var Infinity, NaN;
+ (123456789 / 0).toString();
+ (+"foo").toString();
+ }
+ expect: {
+ var Infinity, NaN;
+ (1/0).toString();
+ (0/0).toString();
+ }
+}
+
beautify_off_1: {
options = {
evaluate: true,