if (reachable) return true;
if (node instanceof AST_Scope && node !== self) {
var parent = scan_scope.parent();
- if (!(parent instanceof AST_Call && parent.expression === node)) {
- node.walk(find_ref);
- }
+ if (parent instanceof AST_Call && parent.expression === node) return;
+ node.walk(find_ref);
return true;
}
});
}
expect_stdout: "function"
}
+
+issue_2701: {
+ options = {
+ dead_code: true,
+ inline: false,
+ }
+ input: {
+ function f(a) {
+ return a = function() {
+ return function() {
+ return a;
+ };
+ }();
+ }
+ console.log(typeof f()());
+ }
+ expect: {
+ function f(a) {
+ return a = function() {
+ return function() {
+ return a;
+ };
+ }();
+ }
+ console.log(typeof f()());
+ }
+ expect_stdout: "function"
+}