From 7971ed33d13d33ad2b1ebf1ddcc57c466b819514 Mon Sep 17 00:00:00 2001 From: Tal Ater Date: Wed, 3 Sep 2014 01:35:30 +0300 Subject: Added a test for else if --- test/compress/conditionals.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index b0234031..c244dc84 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -246,6 +246,14 @@ cond_7: { x = 2; } + if (y) { + x = 1+1; + } else if (z) { + x = 2; + } else { + x = 3-1; + } + x = y ? 'foo' : 'fo'+'o'; x = y ? 'foo' : y ? 'foo' : 'fo'+'o'; @@ -266,6 +274,7 @@ cond_7: { x = some_condition() ? 'foo' : 'fo'+'o'; } expect: { + x = 2; x = 2; x = 'foo'; x = 'foo'; -- cgit v1.2.3