From f5cbe19b753bf84f8b11f96e2c91a8ca49525dba Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 1 Mar 2017 04:12:10 +0800 Subject: invert `reduce_vars` tracking flag (#1519) Modules like webpack and grunt-contrib-uglify still uses `ast.transform(compressor)` before `Compressor.compress(ast)` was introduced. Workaround this compatibility issue by deactivating `reduce_vars` in such case. Also fix use case with omitted `options` when calling `Compressor()`. fixes #1516 --- test/mocha/minify.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/mocha/minify.js') diff --git a/test/mocha/minify.js b/test/mocha/minify.js index baac2a41..2cc800fe 100644 --- a/test/mocha/minify.js +++ b/test/mocha/minify.js @@ -182,4 +182,13 @@ describe("minify", function() { }); }); + describe("Compressor", function() { + it("should be backward compatible with ast.transform(compressor)", function() { + var ast = Uglify.parse("function f(a){for(var i=0;i