diff options
Diffstat (limited to 'test/compress/numbers.js')
-rw-r--r-- | test/compress/numbers.js | 34 |
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 +} |