diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-07-29 23:02:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-29 23:02:04 +0800 |
commit | a845897758aa2cbccf71f37643d31b08cdd22a0e (patch) | |
tree | a845d73050ec30bbc089252df13a2258053c5e65 /test/mocha/minify.js | |
parent | 32ea2c5530079ddbbbc50b23b2adeff44ba7b5df (diff) | |
download | tracifyjs-a845897758aa2cbccf71f37643d31b08cdd22a0e.tar.gz tracifyjs-a845897758aa2cbccf71f37643d31b08cdd22a0e.zip |
improve `mangle.properties` (#2261)
- include dead code when `keep_quoted`
- unify `keep_quoted` & `reserved`
- make `test/run-tests.js` consistent with `minify()`
fixes #2256
Diffstat (limited to 'test/mocha/minify.js')
-rw-r--r-- | test/mocha/minify.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/mocha/minify.js b/test/mocha/minify.js index 88e9c4eb..fc7332fb 100644 --- a/test/mocha/minify.js +++ b/test/mocha/minify.js @@ -124,6 +124,17 @@ describe("minify", function() { assert.strictEqual(result.code, 'a["foo"]="bar",a.a="red",x={"bar":10};'); }); + it("Should not mangle quoted property within dead code", function() { + var result = Uglify.minify('({ "keep": 1 }); g.keep = g.change;', { + mangle: { + properties: { + keep_quoted: true + } + } + }); + if (result.error) throw result.error; + assert.strictEqual(result.code, "g.keep=g.g;"); + }); }); describe("inSourceMap", function() { |