// a function expression's argument cannot shadow the function expression's name
var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();
+
+ // the function's mangled_name is null when keep_fnames is true
+ var tricky_name = tricky_def ? tricky_def.mangled_name || tricky_def.name : null;
+
while (true) {
var name = AST_Lambda.prototype.next_mangled.call(this, options, def);
- if (!(tricky_def && tricky_def.mangled_name == name))
+ if (!tricky_name || tricky_name != name)
return name;
}
});
--- /dev/null
+mangle_keep_fnames_false: {
+ options = {
+ keep_fnames : true,
+ keep_fargs : true,
+ }
+ mangle = {
+ keep_fnames : false,
+ }
+ input: {
+ "use strict";
+ function total() {
+ return function n(a, b, c) {
+ return a + b + c;
+ };
+ }
+ }
+ expect: {
+ "use strict";
+ function total() {
+ return function t(n, r, u) {
+ return n + r + u;
+ };
+ }
+ }
+}
+
+mangle_keep_fnames_true: {
+ options = {
+ keep_fnames : true,
+ keep_fargs : true,
+ }
+ mangle = {
+ keep_fnames : true,
+ }
+ input: {
+ "use strict";
+ function total() {
+ return function n(a, b, c) {
+ return a + b + c;
+ };
+ }
+ }
+ expect: {
+ "use strict";
+ function total() {
+ return function n(t, r, u) {
+ return t + r + u;
+ };
+ }
+ }
+}
+