aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-30 16:09:00 +0800
committerGitHub <noreply@github.com>2017-03-30 16:09:00 +0800
commit7cb1adf455f8ab440e1971ae41265c1f7f9a806a (patch)
treeb58d92e4b41b874c4987403c631d240ec1317a03 /test/compress
parent7bea38a05dbe357434001fe59dbe06bb659a585f (diff)
downloadtracifyjs-7cb1adf455f8ab440e1971ae41265c1f7f9a806a.tar.gz
tracifyjs-7cb1adf455f8ab440e1971ae41265c1f7f9a806a.zip
remove paranthesis for `-(x*y)` (#1732)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/numbers.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js
index ea439ecc..946a7f2d 100644
--- a/test/compress/numbers.js
+++ b/test/compress/numbers.js
@@ -168,3 +168,37 @@ issue_1710: {
}
expect_stdout: true
}
+
+unary_binary_parenthesis: {
+ input: {
+ var v = [ 0, 1, NaN, Infinity, null, undefined, true, false, "", "foo", /foo/ ];
+ v.forEach(function(x) {
+ v.forEach(function(y) {
+ console.log(
+ +(x*y),
+ +(x/y),
+ +(x%y),
+ -(x*y),
+ -(x/y),
+ -(x%y)
+ );
+ });
+ });
+ }
+ expect: {
+ var v = [ 0, 1, 0/0, 1/0, null, void 0, true, false, "", "foo", /foo/ ];
+ v.forEach(function(x) {
+ v.forEach(function(y) {
+ console.log(
+ +x*y,
+ +x/y,
+ +x%y,
+ -x*y,
+ -x/y,
+ -x%y
+ );
+ });
+ });
+ }
+ expect_stdout: true
+}