Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Apr 28, 2011
Commits on Apr 27, 2011
  1. @schmerg

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

    schmerg authored 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
        (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. @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
    …atement
    
    [ 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
    …teger.
    
    That is, the correct transformation for (0.9).toFixed() is .9.toFixed()
    (fixes #109)
Commits on Mar 13, 2011
  1. @mishoo
Commits on Mar 8, 2011
  1. @chriskr
Commits on Feb 28, 2011
  1. @mishoo
  2. @mishoo

    added --ascii option, useful to encode non-ASCII characters as \uXXXX.

    mishoo authored
    apply this to literal object property names and identifiers too.
  3. @marijnh

    add an ascii_only option to gen_code

    marijnh authored
    This will make sure string literals have non-ascii characters
    escaped as \u sequences, so that the resulting file can be
    served up any old way without causing encoding problems.
    
    Slightly changes the parameter conventions for gen_code (in
    a backwards-compatible way). If you want to pass options
    without pretty-printing, the second argument to gen_code
    should have a beautify: false property. So to get ascii_only
    mode, you pass {ascii_only: true, beautify: false}.
Commits on Feb 25, 2011
  1. @mishoo
Commits on Feb 22, 2011
  1. @mishoo

    fixes #99

    mishoo authored
Commits on Feb 20, 2011
  1. @mishoo

    reverted 687382e and updated testparser.js

    mishoo authored
    to use valid code.
  2. @mishoo

    renamed variable "strict_mode" to "exigent_mode", to avoid confusion …

    mishoo authored
    …with
    
    ES5's "use strict;" (which, for the time being, we don't care about).
  3. @mishoo

    support funny cases of for-in:

    mishoo authored
    for (var x = 5 in y);
    for (a[i++] in z);
    
    (essentially ported Marijn's fix from
    marijnh/parse-js@3011e58
    and updated the walker/mangler/generator)
  4. @mishoo
  5. @mishoo
Something went wrong with that request. Please try again.