From 0b3705e82f550b82bebb0c4f877ce8f41fc7495d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 22 Oct 2019 15:41:55 +0800 Subject: fix corner cases in `inline` (#3507) fixes #3506 --- lib/compress.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/compress.js b/lib/compress.js index 8ef94e43..2b61e91c 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3643,8 +3643,8 @@ merge(Compressor.prototype, { if (!(sym.definition().id in in_use_ids)) { sym.__unused = true; if (trim) { + log(sym, "Dropping unused function argument {name} [{file}:{line},{col}]", template(sym)); a.pop(); - AST_Node[sym.unreferenced() ? "warn" : "info"]("Dropping unused function argument {name} [{file}:{line},{col}]", template(sym)); } } else { trim = false; @@ -3654,7 +3654,7 @@ merge(Compressor.prototype, { if (drop_funcs && node instanceof AST_Defun && node !== self) { var def = node.name.definition(); if (!(def.id in in_use_ids)) { - AST_Node[node.name.unreferenced() ? "warn" : "info"]("Dropping unused function {name} [{file}:{line},{col}]", template(node.name)); + log(node.name, "Dropping unused function {name} [{file}:{line},{col}]", template(node.name)); def.eliminated++; return make_node(AST_EmptyStatement, node); } @@ -3742,7 +3742,7 @@ merge(Compressor.prototype, { AST_Node.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", template(def.name)); side_effects.push(value); } else { - AST_Node[def.name.unreferenced() ? "warn" : "info"]("Dropping unused variable {name} [{file}:{line},{col}]", template(def.name)); + log(def.name, "Dropping unused variable {name} [{file}:{line},{col}]", template(def.name)); } sym.eliminated++; } @@ -3820,6 +3820,10 @@ merge(Compressor.prototype, { return node; } + function log(sym, text, props) { + AST_Node[sym.unreferenced() ? "warn" : "info"](text, props); + } + function template(sym) { return { name : sym.name, @@ -5202,7 +5206,7 @@ merge(Compressor.prototype, { if (stat instanceof AST_SimpleStatement) { return make_node(AST_UnaryPrefix, stat, { operator: "void", - expression: stat.body.clone(true) + expression: stat.body }); } } -- cgit v1.2.3 d-securityimage): Update to 1.75. Tobias Geerinckx-Rice 2019-03-14gnu: perl-gd: Update to 2.71....* gnu/packages/gd.scm (perl-gd): Update to 2.71. Tobias Geerinckx-Rice 2019-02-19gnu: libgd: Fix CVE-2019-{6977,6978}....* gnu/packages/gd.scm (gd)[replacement]: New field. (gd/fixed): New variable. * gnu/packages/patches/gd-CVE-2019-6977.patch, gnu/packages/patches/gd-CVE-2019-6978.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. Leo Famulari 2018-11-14gnu: perl: Return #t from all phases....* gnu/packages/gd.scm (perl-gd-securityimage) * gnu/packages/libevent.scm (perl-ev) * gnu/packages/markup.scm (perl-text-markdown-discount) * gnu/packages/perl-check.scm (perl-test2-bundle-extended) * gnu/packages/perl.scm (perl-digest-md5, perl-encode-hanextra) (perl-ipc-run, perl-pathtools) * gnu/packages/photo.scm (perl-image-exiftool): Return #t from all phases. Mark H Weaver 2018-09-10gnu: libgd: Incorporate grafted changes....* gnu/packages/gd.scm (gd)[replacement]: Remove field. [source](patches): Add "gd-CVE-2018-5711.patch" and "gd-CVE-2018-1000222.patch". (gd/fixed): Remove variable. * gnu/packages/php.scm (gd-for-php): Remove variable. (php)[inputs]: Change GD-FOR-PHP to GD. Marius Bakke 2018-09-09gnu: libgd: Fix CVE-2018-{5711,1000222}....* gnu/packages/patches/gd-CVE-2018-1000222.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gd.scm (gd/fixed): New variable. * gnu/packages/php.scm (gd-for-php)[source]: Use 'gd-CVE-2018-1000222.patch'. Leo Famulari 2018-08-30gnu: perl-gd: Update to 2.69....* gnu/packages/gd.scm (perl-gd): Update to 2.69. Tobias Geerinckx-Rice 2018-08-11Migrate search.cpan.org home pages to metacpan.org....The venerable search.cpan.org has retired[0]. [0]: https://log.perl.org/2018/05/goodbye-search-dot-cpan-dot-org.html * guix/import/cpan.scm (cpan-home): Generate metacpan.org home page URIs. Update all previously generated ones in (gnu packages) to their canonical new homes. Tobias Geerinckx-Rice 2018-02-27gnu: perl-gd: Update to 2.68....* gnu/packages/gd.scm (perl-gd): Update to 2.68. [source]: Remove obsolete patch. [native-inputs]: Remove perl-module-build. [inputs]: Use canonical package names and order alphabetically. [arguments]: Replace #:module-build-flags with fewer #:make-maker-flags, enable #:tests?, and remove ‘clear-autogenerated-files’ phase. * gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Tobias Geerinckx-Rice 2017-09-20gnu: Use 'modify-phases' syntax....* gnu/packages/admin.scm (mingetty, clusterssh, wpa-supplicant-minimal, wpa-supplicant, wakelan, acpica, tree, direvent, dstat)[arguments]: Use 'modify-phases' syntax. * gnu/packages/algebra.scm (arb)[arguments]: Likewise. * gnu/packages/apr.scm (apr-util)[arguments]: Likewise. * gnu/packages/audio.scm (clalsadrv, fluidsynth, faad2, lv2-mda-piano, lv2-mda-epiano, timidity++, vamp, soundtouch, portaudio, rsound, zita-convolver, zita-alsa-pcmi)[arguments]: Likewise. * gnu/packages/backup.scm (rdup, btar)[arguments]: Likewise. * gnu/packages/bioinformatics.scm (bedops, bwa, crossmap, express, flexbar, grit, hisat, ngs-sdk, subread)[arguments]: Likewise. * gnu/packages/bittorrent.scm (transmission)[arguments]: Likewise. * gnu/packages/cdrom.scm (cd-discid)[arguments]: Likewise. * gnu/packages/compression.scm (sharutils)[arguments]: Likewise. * gnu/packages/conky.scm (conky)[arguments]: Likewise. * gnu/packages/databases.scm (bdb, bdb-5.3)[arguments]: Likewise. * gnu/packages/debug.scm (delta, c-reduce)[arguments]: Likewise. * gnu/packages/display-managers.scm (slim)[arguments]: Likewise. * gnu/packages/dns.scm (dnsmasq)[arguments]: Likewise. * gnu/packages/emacs.scm (geiser, emacs-wget, bbdb)[arguments]: Likewise. * gnu/packages/engineering.scm (pcb)[arguments]: Likewise. * gnu/packages/firmware.scm (ath9k-htc-firmware)[arguments]: Likewise. * gnu/packages/flashing-tools.scm (flashrom)[arguments]: Likewise. * gnu/packages/fltk.scm (fltk)[arguments]: Likewise. * gnu/packages/freedesktop.scm (python-pyxdg)[arguments]: Likewise. * gnu/packages/gd.scm (perl-gd)[arguments]: Likewise. * gnu/packages/gkrellm.scm (gkrellm)[arguments]: Likewise. * gnu/packages/glib.scm (glibmm)[arguments]: Likewise. * gnu/packages/gl.scm (glew)[arguments]: Likewise. * gnu/packages/gnome.scm (icon-naming-utils, orbit2, libbonobo, gnome-vfs, libgnome, libbonoboui, goffice-0.8, dconf)[arguments]: Likewise. * gnu/packages/gprolog.scm (gprolog)[arguments]: Likewise. * gnu/packages/gps.scm (gpscorrelate)[arguments]: Likewise. * gnu/packages/graphics.scm (agg)[arguments]: Likewise. * gnu/packages/gtk.scm (ganv, girara, gtksourceview-2, guile-present, python2-pycairo)[arguments]: Likewise. * gnu/packages/guile.scm (guile-1.8)[arguments]: Likewise. * gnu/packages/guile-wm.scm (guile-wm)[arguments]: Likewise. * gnu/packages/hugs.scm (hugs)[arguments]: Likewise. * gnu/packages/hurd.scm (gnumach-headers, hurd-headers, hurd-minimal) [arguments]: Likewise. * gnu/packages/image-viewers.scm (feh, sxiv)[arguments]: Likewise. * gnu/packages/libcanberra.scm (libcanberra)[arguments]: Likewise. * gnu/packages/linux.scm (bridge-utils, iw, fuse, unionfs-fuse/static, lm-sensors, i2c-tools, xsensors, perf, mdadm, libaio, module-init-tools) [arguments]: Likewise. * gnu/packages/lisp.scm (ccl)[arguments]: Likewise. * gnu/packages/lout.scm (lout)[arguments]: Likewise. * gnu/packages/lua.scm (luajit)[arguments]: Likewise. * gnu/packages/machine-learning.scm (shogun)[arguments]: Likewise. * gnu/packages/mail.scm (exim)[arguments]: Likewise. * gnu/packages/man.scm (man-pages, txt2man)[arguments]: Likewise. * gnu/packages/maths.scm (lapack, superlu-dist, openlibm, openspecfun) [arguments]: Likewise. * gnu/packages/messaging.scm (bitlbee)[arguments]: Likewise. * gnu/packages/mp3.scm (libmad, id3lib, mp3info)[arguments]: Likewise. * gnu/packages/music.scm (solfege)[arguments]: Likewise. * gnu/packages/noweb.scm (noweb)[arguments]: Likewise. * gnu/packages/patchutils.scm (patchutils, quilt, colordiff)[arguments]: Likewise. * gnu/packages/pdf.scm (xpdf, zathura-cb, zathura-ps, zathura-djvu, zathura-pdf-poppler, zathura, podofo, fbida)[arguments]: Likewise. * gnu/packages/perl.scm (perl-file-list, perl-test-harness)[arguments]: Likewise. * gnu/packages/photo.scm (gphoto2)[arguments]: Likewise. * gnu/packages/popt.scm (popt)[arguments]: Likewise. * gnu/packages/pretty-print.scm (source-highlight, astyle)[arguments]: Likewise. * gnu/packages/pumpio.scm (pumpa)[arguments]: Likewise. * gnu/packages/python.scm (python-passlib, python-pycrypto, python2-empy, python-sqlalchemy, python-docopt)[arguments]: Likewise. * gnu/packages/rdf.scm (lrdf)[arguments]: Likewise. * gnu/packages/regex.scm (tre)[arguments]: Likewise. * gnu/packages/rrdtool.scm (rrdtool)[arguments]: Likewise. * gnu/packages/ruby.scm (ruby-2.1, ruby-1.8)[arguments]: Likewise. * gnu/packages/sawfish.scm (sawfish)[arguments]: Likewise. * gnu/packages/scheme.scm (racket)[arguments]: Likewise. * gnu/packages/sdl.scm (guile-sdl)[arguments]: Likewise. * gnu/packages/serveez.scm (serveez)[arguments]: Likewise. * gnu/packages/skribilo.scm (skribilo)[arguments]: Likewise. * gnu/packages/smalltalk.scm (smalltalk)[arguments]: Likewise. * gnu/packages/suckless.scm (dmenu, slock)[arguments]: Likewise. * gnu/packages/tcl.scm (expect)[arguments]: Likewise. * gnu/packages/telephony.scm (commoncpp)[arguments]: Likewise. * gnu/packages/textutils.scm (recode, libgtextutils)[arguments]: Likewise. * gnu/packages/time.scm (time)[arguments]: Likewise. * gnu/packages/tor.scm (privoxy)[arguments]: Likewise. * gnu/packages/uucp.scm (uucp)[arguments]: Likewise. * gnu/packages/video.scm (libdvdnav-4)[arguments]: Likewise. * gnu/packages/web-browsers.scm (lynx)[arguments]: Likewise. * gnu/packages/web.scm (tinyproxy)[arguments]: Likewise. * gnu/packages/wicd.scm (wicd)[arguments]: Likewise. * gnu/packages/wm.scm (bspwm)[arguments]: Likewise. * gnu/packages/xdisorg.scm (sxhkd, xcape)[arguments]: Likewise. * gnu/packages/xfce.scm (xfconf)[arguments]: Likewise. * gnu/packages/xfig.scm (transfig)[arguments]: Likewise. * gnu/packages/xorg.scm (imake)[arguments]: Likewise. Kei Kebreau 2017-09-20gnu: gd: Remove graft for 2.2.5....* gnu/packages/gd.scm (gd): Update to 2.2.5. [source]: Remove obsolete patches. [replacement]: Remove field. (gd-2.2.5): Remove variable. * gnu/packages/patches/gd-fix-gd2-read-test.patch, gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove patches. * gnu/packages/php.scm (php)[inputs]: Replace GD-2.2.5 with GD. Marius Bakke 2017-08-31gnu: gd: Replace with 2.2.5....Fixes CVE-2017-6362 and CVE-2017-7890. * gnu/packages/gd.scm (gd)[replacement]: New field. (gd-2.2.5): New variable. * gnu/packages/php.scm (gd-for-php): Remove variable (php)[inputs]: Replace GD-FOR-PHP with GD-2.2.5. * gnu/packages/patches/gd-CVE-2017-7890.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Marius Bakke 2017-07-27gnu: perl-gd-securityimage: Fix build with Perl 5.26.0....* gnu/packages/gd.scm (perl-gd-securityimage)[arguments]: Set PERL_USE_UNSAFE_INC in new 'set-env' phase. Leo Famulari 2017-05-02gnu: Avoid circular dependencies by Perl license....* guix/licenses.scm (perl-license): New variable. * gnu/packages/bioinformatics.scm: Change (package-license perl) to perl-license. * gnu/packages/compression.scm: Same. * gnu/packages/databases.scm: Same. * gnu/packages/gd.scm: Same. * gnu/packages/language.scm: Same. * gnu/packages/libevent.scm: Same. * gnu/packages/mail.scm: Same. * gnu/packages/messaging.scm: Same. * gnu/packages/ncurses.scm: Same. * gnu/packages/networking.scm: Same. * gnu/packages/photo.scm: Same. * gnu/packages/tcl.scm: Same. * gnu/packages/tex.scm: Same. * gnu/packages/tls.scm: Same. * gnu/packages/web.scm: Same. * gnu/packages/wm.scm: Same. * gnu/packages/xml.scm: Same. * gnu/packages/xorg.scm: Same. * gnu/packages/zip.scm: Same. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Petter 2017-03-03gnu: gd: Fix an issue with XBM decoding....* gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch: New file. * gnu/local.scm (dist_patch_DATA): Add it. * gnu/packages/gd.scm (gd)[source]: Use it. Signed-off-by: Leo Famulari <leo@famulari.name> Julien Lepiller 2017-03-01gnu: gd: Fix test failure on aarch64....* gnu/packages/gd.scm (gd)[arguments]: Add make-flag -ffp-contract=off to work around upstream bug 278. Efraim Flashner 2017-02-26gnu: gd: Fix test failure with FreeType 2.7....* gnu/packages/patches/gd-freetype-test-failure.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gd.scm (gd)[source]: Use it. Leo Famulari 2017-01-25gnu: gd: Incorporate grafted changes....* gnu/packages/gd.scm (gd)[replacement]: Remove field. [source]: Update to 2.2.4. Remove patches 'gd-CVE-2016-7568.patch' and 'gd-CVE-2016-8670.patch'. [arguments]: New field. (gd-2.2.4): Remove variable. * gnu/packages/patches/gd-CVE-2016-7568.patch, gnu/packages/patches/gd-CVE-2016-8670.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. Leo Famulari 2017-01-20gnu: gd: Fix source URL....This is a followup to 3f0603ea653cefa9ff728c2637d3cd0d778b3602. * gnu/packages/gd.scm (gd-2.2.4)[source]: Fix URL. Marius Bakke 2017-01-20gnu: gd: Replace with gd-2.2.4 [fixes CVE-2016-{6912,9317} and others]....'CHANGELOG.md' in the development repository lists several fixed bugs with potential security implications: https://github.com/libgd/libgd/blob/gd-2.2.4/CHANGELOG.md * gnu/packages/gd.scm (gd)[replacement]: New field. (gd-2.2.4): New variable. Leo Famulari