aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
AgeCommit message (Expand)Author
2012-11-14better solution for the last test in constant switch foldingMihai Bazon
2012-11-14optimize constant switch blocks...ref. mishoo/UglifyJS#441 Mihai Bazon
2012-11-13Merge branch 'optimize_concat' of https://github.com/rvanvelzen/UglifyJS2 int...Mihai Bazon
2012-11-13don't change order in binary expressions if both operands have side effectsMihai Bazon
2012-11-12Add simple optimization for empty-string concats....ref. #43 Richard van Velzen
2012-11-12fix invalid AST produced by dropping unused variable...close #44 Mihai Bazon
2012-11-11convert x.toString() to ""+x instead of x+""...In some places this can save one byte in whitespace, e.g. after return. Example: function f(arg) { // return""+arg - no space between return and "" return arg.toString(); } Dan Wolff
2012-11-08AST_LabelRef no longer inherits from AST_SymbolRefMihai Bazon
2012-11-08optimization for if/break as first statement in a loop body... for(...; x; ...) if (y) break; → for(...; x&&!y; ...); similarly for `while` and some combinations (i.e. the `break` appears in the `else` clause, etc.) Mihai Bazon
2012-11-05convert `while` into `for`Mihai Bazon
2012-11-05minorMihai Bazon
2012-11-05minor optimization...for `==` or `!=` against a constant, prefer to display the constant first. should help a bit after gzip, i.e.: typeof foo=="undefined" ^^^^^^ ^^^^^^^^^^^^^ vs: "undefined"==typeof foo ^^^^^^^^^^^^^^^^^^^ (longer sequence that could repeat) idea stolen from closure. Mihai Bazon
2012-11-02use a Dictionary object instead of plain object for hashes...to mitigate the `__proto__` issue related to #30 Mihai Bazon
2012-11-01it's safe to negate expression in !EXP only in boolean context...#kendo Mihai Bazon
2012-11-01added unsafe_comps for negating `<=` with `>`...since it has the potential to break code, let's keep it disabled by default Mihai Bazon
2012-11-01fix compressing UnaryPrefix...only try negating the expression if the operator is `!` #kendo Mihai Bazon
2012-10-30don't move expressions containing the binary `in` operator into the `for` ini......(opera can't parse it) close #25 Mihai Bazon
2012-10-24fix for `if (...) return; else return ...;`...(it was assumed that the first `return` always contains a value) close #22 Mihai Bazon
2012-10-22more sequence optimizations (lift some sequences above binary/unary expressio...Mihai Bazon
2012-10-19minor fix for dropping unused definitions.... function f(x, y) { var g = function() { return h() }; var h = function() { return g() }; return x + y; } now compresses to `function f(x, y) { return x + y }` Mihai Bazon
2012-10-18more optimizations for some break/continue casesMihai Bazon
2012-10-17more small optimizations...(unlikely to help for hand-written code) Mihai Bazon
2012-10-17define aborts on AST_If: true if both branches abortMihai Bazon
2012-10-17employ a better parser for command-line arguments...to support passing commas in strings in for example: uglifyjs2 -cd TEST="'a,b'" <<EOF console.log(TEST); EOF → console.log("a,b") close #14 Mihai Bazon
2012-10-13drop unused function arguments...also add test for "drop_unused" (the last one fails for now) Mihai Bazon
2012-10-13fix compressing benchmark.js (it tried to evaluate a statement)...the following code in benchmark.js triggered the issue: support.decompilation = Function( 'return (' + (function(x) { return { 'x': '' + (1 + x) + '', 'y': 0 }; }) + ')' )()(0).x === '1'; technically that could be resolved into a constant expression, but seems it's being used here for browser bugs detection :-\ Mihai Bazon
2012-10-12remove the $self hack...operations are destructive anyway, so there's no point to clone the nodes in the transformer. speed++ Mihai Bazon
2012-10-11cleanup...- use prototype-less objects where feasible (minor speed improvement) - get rid of HOP Mihai Bazon
2012-10-10drop unused variableMihai Bazon
2012-10-09minorMihai Bazon
2012-10-09add AST_Infinity nodeMihai Bazon
2012-10-09added $propdoc to AST nodes and some cleanups...hopefully we can make the AST documentation self-generating Mihai Bazon
2012-10-09minor AST cleanup (AST_BlockStatement may inherit from AST_Block)Mihai Bazon
2012-10-09fix detecting symbols in useMihai Bazon
2012-10-08eliminate redundant directives in the same scopeMihai Bazon
2012-10-05minorMihai Bazon
2012-10-05replace `(function(){ ...no side effects ... })()` with `undefined`.Mihai Bazon
2012-10-04removed some unused variablesMihai Bazon
2012-10-03more cleanup (dropped AST_SwitchBlock)Mihai Bazon
2012-10-03AST cleanup (dropped AST_StatementBase)Mihai Bazon
2012-10-03added option for side-effect-free statements, fix testMihai Bazon
2012-10-03fix endless loop in testsMihai Bazon
2012-10-03fix for `a = !b && !c && !d && !e → a=!(b||c||d||e)`Mihai Bazon
2012-10-03disable `hoist_vars` by default and change `comparations` to `comparisons`Mihai Bazon
2012-10-02support definesMihai Bazon
2012-10-02"use strict";Mihai Bazon
2012-10-02more constant folding (for names defined with `const`)Mihai Bazon
2012-10-02drop more unused namesMihai Bazon
2012-10-02a shy attempt to obey `width` in the beautifier; added `bracketize` option to...Mihai Bazon
2012-09-26removed the "squeeze" method (it's now effectively "transform")Mihai Bazon
n title='2019-07-16 23:00:10 +0200'>2019-07-16Use more guix.gnu.org....* build-aux/build-self.scm (make-config.scm): Replace gnu.org/s/guix with guix.gnu.org. * guix/scripts/publish.scm (render-home-page): Likewise. * guix/self.scm (make-config.scm): Likewise. Tobias Geerinckx-Rice 2019-05-12build-self: Let HOME pass through the execution environment....This is a followup to 48d498c2c3984784336b27ba5e261319f3ac6a3a, which introduced a typo (missing '->' in 'mlet'.) Fixes <https://bugs.gnu.org/35623>. Reported by Karrick McDermott <kmcdermott@linkedin.com>. * build-aux/build-self.scm (build): Add 'getenv' and 'setenv' calls for HOME. Ludovic Courtès 2019-05-11Revert "build-self: Let HOME pass through the execution environment."...This reverts commit 48d498c2c3984784336b27ba5e261319f3ac6a3a. It breaks ‘guix pull’. Tobias Geerinckx-Rice 2019-05-11build-self: Let HOME pass through the execution environment....Fixes <https://bugs.gnu.org/35623>. Reported by Karrick McDermott <kmcdermott@linkedin.com>. * build-aux/build-self.scm (build): Add 'getenv' and 'setenv' calls for HOME. Ludovic Courtès 2019-04-23build-self: Explain why we keep using deprecated bindings....* build-aux/build-self.scm (build): Add comment regarding the deprecated names. Ludovic Courtès 2019-04-23Revert "build-self: Avoid deprecated bindings."...This reverts commit fa9e6e8b676ca920a894cf3b48bfcb670077144f. By using the new bindings, we would prevent users of Guix prior to de9fbe9cdcf5f8deb08becfc54b523084fd67bda, such as version 0.16.0, to upgrade to current master. Thus, we will keep using the old names for a while. Ludovic Courtès 2019-04-22build-self: Avoid deprecated bindings....* build-aux/build-self.scm (build): Replace references to nix-server-* with store-connection-*. Mark H Weaver 2019-04-17self: Remove unused variable....This variable is unused since commit 45779fa676419de8838cb26b6c7a24678a2be1cd. * guix/self.scm (%dependency-variables): Remove. * build-aux/build-self.scm (%dependency-variables): Remove. Ludovic Courtès 2019-03-26build-self: Disable position recording....'guix pull -n' goes roughly from 40s to 35s. * build-aux/build-self.scm (build-program): Add call to 'read-disable'. Ludovic Courtès 2019-02-04daemon: Rename 'NIX_STATE_DIR' and 'NIX_DB_DIR' environment variables....Fixes <https://bugs.gnu.org/22459>. Reported by Jeff Mickey <j@codemac.net>. * guix/config.scm.in (%state-directory): Change NIX_STATE_DIR to GUIX_STATE_DIRECTORY. (%store-database-directory): Change NIX_DB_DIR to GUIX_DATABASE_DIRECTORY. * nix/libstore/globals.cc (Settings::processEnvironment): Likewise. * guix/self.scm (make-config.scm): Likewise. * build-aux/build-self.scm (make-config.scm): Likewise. * build-aux/test-env.in: Likewise. * tests/derivations.scm ("derivation #:leaked-env-vars"): Likewise. * tests/guix-build.sh (GUIX_DAEMON_SOCKET): Likewise. * tests/guix-daemon.sh (socket): Likewise. Ludovic Courtès 2019-01-21build-self: Execute trampoline in a clean environment....Previously execution of the trampoline would be somewhat sensitive to GUILE_LOAD_PATH & co., for example. * build-aux/build-self.scm (build-program): Remove 'unsetenv' call and %LOAD-COMPILED-PATH hack. (call-with-clean-environment): New procedure. (with-clean-environment): New macro. (build): Wrap 'open-pipe*' call in 'with-clean-environment'. Ludovic Courtès