diff options
author | alexlamsl <alexlamsl@gmail.com> | 2017-02-18 19:00:54 +0800 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2017-02-18 19:00:54 +0800 |
commit | fa668a28b47e06d838659d4e0910460c84ca3a61 (patch) | |
tree | 602230f955f901780f5e0577b76706d72bf8a832 /test | |
parent | 686a496b1c8c3762768c0da6ef98b37167d4d4ba (diff) | |
download | tracifyjs-fa668a28b47e06d838659d4e0910460c84ca3a61.tar.gz tracifyjs-fa668a28b47e06d838659d4e0910460c84ca3a61.zip |
fix corner case in keep_fnames
happens when inner function:
- just below top level
- not referenced
- `unused` is disabled
closes #1445
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/issue-1431.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/issue-1431.js b/test/compress/issue-1431.js index 731ebba8..9493fd37 100644 --- a/test/compress/issue-1431.js +++ b/test/compress/issue-1431.js @@ -1,3 +1,32 @@ +level_zero: { + options = { + keep_fnames: true + } + mangle = { + keep_fnames: true + } + input: { + function f(x) { + function n(a) { + return a * a; + } + return function() { + return x; + }; + } + } + expect: { + function f(r) { + function n(n) { + return n * n; + } + return function() { + return r; + }; + } + } +} + level_one: { options = { keep_fnames: true |