From b9dc8a1b5d715252d930f603fdd2a68d4f0e6381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Santos?= Date: Tue, 27 Feb 2018 15:24:29 +0000 Subject: [PATCH] fix: add expect_stdout to test output --- test/compress/functions.js | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/test/compress/functions.js b/test/compress/functions.js index 95e674a3..9d82b9e2 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -2033,25 +2033,40 @@ inline_true: { issue_2842: { options = { - inline: true, - toplevel: true, + side_effects: true, reduce_vars: true, reduce_funcs: true, + unused: true, } input: { - { - const data = function (data) { + (function() { + function inlinedFunction(data) { return data[data[0]]; - }([1, 2, 3]); - } + } + function testMinify() { + if (true) { + const data = inlinedFunction([1, 2, 3]); + console.log(data); + } + } + return testMinify(); + })(); } expect: { - { - const data = function (data) { - return data[data[0]]; - }([1, 2, 3]); - } + (function () { + (function () { + if (true) { + const data = function (data) { + return data[data[0]]; + }([1, 2, 3]); + console.log(data); + } + })(); + })(); } + expect_stdout: [ + "2" + ] } use_before_init_in_loop: {