Permalink
Commits on Jun 3, 2011
  1. blarggghhh

    isaacs committed Jun 3, 2011
  2. Use splice, now that it works

    isaacs committed Apr 24, 2011
Commits on May 24, 2011
Commits on May 19, 2011
  1. v1.0.2 -- fixes #152

    mishoo committed May 19, 2011
Commits on May 15, 2011
  1. simple "make" utility. ideas welcome.

    mishoo committed May 15, 2011
    For now, write a Makefile.uglify.js file with contents like this:
    
        {
          files: [
            { name: "foo.js", module: "Foo" },
            { name: "bar.js", hide: true }
          ]
        }
    
    If you run uglifyjs --make it will read and compress foo.js and wrap it like
    this:
    
        (function(){ return this })().Foo = (function(exports, global){
            ... compressed contents of foo.js ...
        })({}, (function(){ return this })());
    
    as for bar.js it'll wrap like this:
    
        (function(){
            ... compressed contents of bar.js ...
        })()
    
    Both of them are concatenated and returned.
    
    The "module" is thus useful to use libraries designed for a CommonJS
    environment in browser.
    
    This is just a quick hack as I needed it fast, but the plan is to evolve
    it—handle compressor options in the Makefile, additional possibilities to
    wrap the files, maybe handle require(...).
Commits on May 13, 2011
  1. Merge pull request #149 from killdream/master

    mishoo committed May 13, 2011
    Adds missing whitespace characters to WHITESPACE_CHARS
Commits on May 12, 2011
  1. options.defines is optional..

    mishoo committed May 12, 2011
Commits on May 9, 2011
Commits on Apr 29, 2011
  1. Merged pull request #137 from tav/master.

    mishoo committed Apr 29, 2011
    Fix for issue 125: constant folding VARIABLES
Commits on Apr 28, 2011
Commits on Apr 27, 2011
  1. Added option to define symbols for replacement (cf #define) and impro…

    schmerg authored and tav committed Apr 27, 2011
    …ved constant folding for shortcut operators ('&&', '||' and ternary conditional operator)
  2. Merged pull request #133 from aaronblohowiak/master.

    mishoo committed Apr 27, 2011
    Convenience function for minification
Commits on Apr 24, 2011
  1. add brackets around splice nodes when they're directly under "for",

    mishoo committed Apr 24, 2011
    "for-in", "if", "while", "do" or "with" nodes
Commits on Apr 23, 2011
  1. make the module exports a convenience function so minifying src with …

    aaronblohowiak committed Apr 23, 2011
    …the defaults is just a one-lininer: min = require('uglify-js')(src);
    
    I am unfamiliar with the documentation generator you use, so I did not update the README.
    
    Addresses Issue 132.
Commits on Apr 22, 2011
  1. better fix for issue #128:

    mishoo committed Apr 22, 2011
        (function(){
            var a = function fact(n){
                if (n == 1) return 1;
                else return n * fact(n - 1);
            };
            // console.log(fact(10)); // this errors out, `fact' not defined
            fact = 5;
            console.log(a(10)); // this works
        })();
        console.log(fact);
    
    The above shows that when a function expression has a name, that name is not
    introduced into the existing scope; instead it's only available in that
    function's body (`fact' can call itself, but we can't call it from outside
    by that name).  It also doesn't introduce a name, which is why setting fact
    = 5 actually creates a global.
    
    So UglifyJS is now able to mangle `fact' in the case above (or drop the name
    in cases where the inner body is not referencing it).  The above mangles to:
    
        (function() {
            var a = function a(b) {
                return b == 1 ? 1 : b * a(b - 1);
            };
            fact = 5, console.log(a(10));
        })(), console.log(fact);
Commits on Apr 17, 2011
  1. only defuns define a new name in the current scope; named lambdas seem

    mishoo committed Apr 17, 2011
    that should not affect it.  (fixes #128)
Commits on Apr 4, 2011
  1. comments (fixes #120)

    mishoo committed Apr 4, 2011
Commits on Apr 3, 2011
  1. NPM changes

    mishoo committed Apr 3, 2011
Commits on Mar 22, 2011
  1. more parens around literal objects/functions when first thing in a st…

    mishoo committed Mar 22, 2011
    …atement
    
    [ will this end? :-) ]
Commits on Mar 20, 2011
  1. removed duplicated operator

    mishoo committed Mar 20, 2011
Commits on Mar 15, 2011
  1. fixed parsing for stuff like 0x12.toFixed() (when we have 0x, the dot…

    mishoo committed Mar 15, 2011
    … cannot
    
    be part of the number)
  2. only add a second dot in forms like (5).toFixed() if the number is in…

    mishoo committed Mar 15, 2011
    …teger.
    
    That is, the correct transformation for (0.9).toFixed() is .9.toFixed()
    (fixes #109)
Commits on Mar 13, 2011