Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jun 3, 2011
  1. blarggghhh

  2. Use splice, now that it works

Commits on May 24, 2011
  1. @mishoo
Commits on May 19, 2011
  1. @mishoo

    v1.0.2 -- fixes #152

    mishoo authored
Commits on May 15, 2011
  1. @mishoo

    simple "make" utility. ideas welcome.

    mishoo authored
    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
        (function(){ return this })().Foo = (function(exports, global){
            ... compressed contents of foo.js ...
        })({}, (function(){ return this })());
    as for bar.js it'll wrap like this:
            ... 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. @mishoo

    Merge pull request #149 from killdream/master

    mishoo authored
    Adds missing whitespace characters to WHITESPACE_CHARS
Commits on May 12, 2011
  1. @mishoo

    options.defines is optional..

    mishoo authored
  2. @mishoo
Commits on May 9, 2011
  1. @robotlolita
Commits on Apr 29, 2011
  1. @mishoo

    Merged pull request #137 from tav/master.

    mishoo authored
    Fix for issue 125: constant folding VARIABLES
Commits on Apr 28, 2011
  1. @tav
Commits on Apr 27, 2011
  1. @schmerg @tav

    Added option to define symbols for replacement (cf #define) and impro…

    schmerg authored tav committed
    …ved constant folding for shortcut operators ('&&', '||' and ternary conditional operator)
  2. @mishoo

    Merged pull request #133 from aaronblohowiak/master.

    mishoo authored
    Convenience function for minification
Commits on Apr 24, 2011
  1. @mishoo

    add brackets around splice nodes when they're directly under "for",

    mishoo authored
    "for-in", "if", "while", "do" or "with" nodes
  2. @mishoo
Commits on Apr 23, 2011
  1. @aaronblohowiak

    make the module exports a convenience function so minifying src with …

    aaronblohowiak authored
    …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.
  2. @mishoo
  3. @mishoo
Commits on Apr 22, 2011
  1. @mishoo

    better fix for issue #128:

    mishoo authored
            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
    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. @mishoo

    only defuns define a new name in the current scope; named lambdas seem

    mishoo authored
    that should not affect it.  (fixes #128)
  2. @mishoo
Commits on Apr 4, 2011
  1. @mishoo
  2. @mishoo

    comments (fixes #120)

    mishoo authored
Commits on Apr 3, 2011
  1. @mishoo

    NPM changes

    mishoo authored
Commits on Mar 22, 2011
  1. @mishoo

    handle conditional operator too

    mishoo authored
  2. @mishoo

    more parens around literal objects/functions when first thing in a st…

    mishoo authored
    [ will this end? :-) ]
  3. @mishoo
  4. @mishoo
  5. @mishoo
Commits on Mar 20, 2011
  1. @mishoo
  2. @mishoo

    removed duplicated operator

    mishoo authored
Commits on Mar 15, 2011
  1. @mishoo

    fixed parsing for stuff like 0x12.toFixed() (when we have 0x, the dot…

    mishoo authored
    … cannot
    be part of the number)
  2. @mishoo

    only add a second dot in forms like (5).toFixed() if the number is in…

    mishoo authored
    That is, the correct transformation for (0.9).toFixed() is .9.toFixed()
    (fixes #109)
Commits on Mar 13, 2011
  1. @mishoo
Something went wrong with that request. Please try again.