aboutsummaryrefslogtreecommitdiff
path: root/gnu
<
index 2530ec9f..4aefb8db 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -10913,9 +10913,10 @@ merge(Compressor.prototype, {
return self;
});
- function recursive_ref(compressor, def) {
+ function recursive_ref(compressor, def, fn) {
var level = 0, node = compressor.self();
do {
+ if (node === fn) return node;
if (is_lambda(node) && node.name && node.name.definition() === def) return node;
} while (node = compressor.parent(level++));
}
@@ -10951,7 +10952,7 @@ merge(Compressor.prototype, {
if ((def.scope !== self.scope.resolve() || def.in_loop)
&& (!compressor.option("reduce_funcs") || def.escaped.depth == 1 || fixed.inlined)) {
single_use = false;
- } else if (recursive_ref(compressor, def)) {
+ } else if (recursive_ref(compressor, def, fixed)) {
single_use = false;
} else if (fixed.name && fixed.name.definition() !== def) {
single_use = false;
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index c1531b25..735688ea 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -7677,3 +7677,22 @@ issue_4949: {
}
expect_stdout: "0 1"
}
+
+issue_5048: {
+ options = {
+ reduce_funcs: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ var a = function() {
+ return a + 42;
+ };
+ }());
+ }
+ expect: {
+ console.log(function() {}());
+ }
+ expect_stdout: "undefined"
+}
AgeCommit message (Expand)Author
2020-12-21gnu: httpstat: Update to 1.3.0....Michael Rohleder
2020-12-21gnu: sdcc: Update to 4.0.0....Simon South
2020-12-21gnu: sdcc: Expand comment regarding GPUTILS and PIC ports....Simon South
2020-12-21gnu: sdcc: Correct name of phase....Simon South
2020-12-21gnu: sdcc: Revise synopsis and description....Simon South
2020-12-21gnu: sdcc: Specify complete set of licenses....Simon South
2020-12-21gnu: sdcc: Move to embedded.scm....Simon South
2020-12-21gnu: sdcc: Remove bundled μCsim....Simon South
2020-12-21gnu: Add μCsim....Simon South
2020-12-21gnu: gnome-builder: Disable jedi plugin....Leo Prikler
2020-12-21gnu: guix-build-coordinator: Update to 0-11.9128f96....Christopher Baines
2020-12-20gnu: Add python-locust....Maxim Cournoyer
d>2020-12-20gnu: python2-graphql-relay: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-gpic: Remove package....Maxim Cournoyer 2020-12-20gnu: bpython2: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-eventlet: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-pynvim: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-greenlet: Remove package....Maxim Cournoyer 2020-12-20gnu: python-werkzeug: Update to 1.0.1....Maxim Cournoyer 2020-12-20gnu: python2-flask-restful-swagger: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-flask-script: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-flask-principal: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-flask-httpauth: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-pytest-httpbin: Remove package....Maxim Cournoyer 2020-12-20gnu: python2-werkzeug: Remove package....Maxim Cournoyer 2020-12-20gnu: Add python-dpkt....Maxim Cournoyer 2020-12-20gnu: python-oslo.config: Fix indentation....Maxim Cournoyer 2020-12-20gnu: python-oslo.i18n: Fix indentation....Maxim Cournoyer 2020-12-20gnu: python-configargparse: Update to 1.2.3....Maxim Cournoyer 2020-12-20gnu: python2-configargparse: Remove package....Maxim Cournoyer 2020-12-20gnu: emacs-nov-el: Update to 0.3.3....Brett Gilio 2020-12-20gnu: libffi: Add unreleased patch to fix float128 on powerpc64le....John Doe 2020-12-21gnu: emacs-js2-mode: Update to 20201220....Nicolas Goaziou 2020-12-21gnu: emacs-diff-hl: Update to 1.8.8....Nicolas Goaziou 2020-12-20gnu: libaom: Update to 2.0.1....Leo Famulari 2020-12-20gnu: straw-viewer: Move youtube-dl to propagated inputs....Brett Gilio