aboutsummaryr
aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-01-26 19:18:28 +0800
committerRichard van Velzen <rvanvelzen1@gmail.com>2017-01-26 12:18:28 +0100
commit1eaa211e0932105439d98d4f03a981f157f0a77c (patch)
tree3167d7068dbf72992dc9df6b6fcabdf9e3b87962 /test/compress
parent0610c020b1544820be9898a285ab6c9066490552 (diff)
downloadtracifyjs-1eaa211e0932105439d98d4f03a981f157f0a77c.tar.gz
tracifyjs-1eaa211e0932105439d98d4f03a981f157f0a77c.zip
fix mangling collision with keep_fnames (#1431)
* fix mangling collision with keep_fnames fixes #1423 * pass mangle options to figure_out_scope() bring command-line in line with minify()
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/issue-1431.js122
1 files changed, 122 insertions, 0 deletions
diff --git a/test/compress/issue-1431.js b/test/compress/issue-1431.js
new file mode 100644
index 00000000..731ebba8
--- /dev/null
+++ b/test/compress/issue-1431.js
@@ -0,0 +1,122 @@
+level_one: {
+ options = {
+ keep_fnames: true
+ }
+ mangle = {
+ keep_fnames: true
+ }
+ input: {
+ function f(x) {
+ return function() {
+ function n(a) {
+ return a * a;
+ }
+ return x(n);
+ };
+ }
+ }
+ expect: {
+ function f(r) {
+ return function() {
+ function n(n) {
+ return n * n;
+ }
+ return r(n);
+ };
+ }
+ }
+}
+
+level_two: {
+ options = {
+ keep_fnames: true
+ }
+ mangle = {
+ keep_fnames: true
+ }
+ input: {
+ function f(x) {
+ return function() {
+ function r(a) {
+ return a * a;
+ }
+ return function() {
+ function n(a) {
+ return a * a;
+ }
+ return x(n);
+ };
+ };
+ }
+ }
+ expect: {
+ function f(t) {
+ return function() {
+ function r(n) {
+ return n * n;
+ }
+ return function() {
+ function n(n) {
+ return n * n;
+ }
+ return t(n);
+ };
+ };
+ }
+ }
+}
+
+level_three: {
+ options = {
+ keep_fnames: true
+ }
+ mangle = {
+ keep_fnames: true
+ }
+ input: {
+ function f(x) {
+ return function() {
+ function r(a) {
+ return a * a;
+ }
+ return [
+ function() {
+ function t(a) {
+ return a * a;
+ }
+ return t;
+ },
+ function() {
+ function n(a) {
+ return a * a;
+ }
+ return x(n);
+ }
+ ];
+ };
+ }
+ }
+ expect: {
+ function f(t) {
+ return function() {
+ function r(n) {
+ return n * n;
+ }
+ return [
+ function() {
+ function t(n) {
+ return n * n;
+ }
+ return t;
+ },
+ function() {
+ function n(n) {
+ return n * n;
+ }
+ return t(n);
+ }
+ ];
+ };
+ }
+ }
+}