@@ -896,8 +896,7 @@ merge(Compressor.prototype, {
|
|||||||
if (lhs instanceof AST_This) return true;
|
if (lhs instanceof AST_This) return true;
|
||||||
if (lhs instanceof AST_SymbolRef) {
|
if (lhs instanceof AST_SymbolRef) {
|
||||||
var def = lhs.definition();
|
var def = lhs.definition();
|
||||||
return def.orig[0] instanceof AST_SymbolLambda
|
return def.lambda || compressor.exposed(def) && identifier_atom[def.name];
|
||||||
|| compressor.exposed(def) && identifier_atom[def.name];
|
|
||||||
}
|
}
|
||||||
if (lhs instanceof AST_PropAccess) {
|
if (lhs instanceof AST_PropAccess) {
|
||||||
lhs = lhs.expression;
|
lhs = lhs.expression;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ function SymbolDef(scope, orig, init) {
|
|||||||
this.mangled_name = null;
|
this.mangled_name = null;
|
||||||
this.undeclared = false;
|
this.undeclared = false;
|
||||||
this.id = SymbolDef.next_id++;
|
this.id = SymbolDef.next_id++;
|
||||||
|
this.lambda = orig instanceof AST_SymbolLambda;
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolDef.next_id = 1;
|
SymbolDef.next_id = 1;
|
||||||
@@ -210,6 +211,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
|||||||
node.thedef = new_def;
|
node.thedef = new_def;
|
||||||
node.reference(options);
|
node.reference(options);
|
||||||
});
|
});
|
||||||
|
if (old_def.lambda) new_def.lambda = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -969,3 +969,47 @@ issue_3355_4: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3468: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
ie8: false,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 42;
|
||||||
|
console.log(function a() {
|
||||||
|
a++;
|
||||||
|
return typeof a;
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 42;
|
||||||
|
console.log(function a() {
|
||||||
|
a++;
|
||||||
|
return typeof a;
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "function"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_3468_ie8: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
ie8: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 42;
|
||||||
|
console.log(function a() {
|
||||||
|
a++;
|
||||||
|
return typeof a;
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 42;
|
||||||
|
console.log(function a() {
|
||||||
|
a++;
|
||||||
|
return typeof a;
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "function"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user