Permalink
Commits on Aug 31, 2011
  1. Added an utility that allows walking depth-first easily.

    mishoo committed Aug 31, 2011
    For example:
    
    w.with_walkers({
        "function": function() {
            var node = w.dive(this); // apply other_walkers to subnodes
            var transformed_node = further_transform(node);
            return transformed_node;
        },
        ... // other_walkers here
    }, ...);
    
    (fixes #213)
Commits on Aug 30, 2011
Commits on Aug 29, 2011
Commits on Aug 27, 2011
Commits on Aug 20, 2011
  1. version 1.0.7

    mishoo committed Aug 20, 2011
  2. updated doc

    mishoo committed Aug 20, 2011
Commits on Aug 16, 2011
  1. Merge pull request #202 from lautis/fix-broken-tests

    mishoo committed Aug 16, 2011
    Fix tests broken after 3cd9829
  2. Fix tests broken after 3cd9829

    lautis committed Aug 15, 2011
  3. Merge pull request #200 from johnjbarton/01a83b461f541898cb4b2f9ef033…

    mishoo committed Aug 16, 2011
    …245c1a7ee18b
    
    Small fix to slice() to make it more robust and less confusing.
Commits on Aug 15, 2011
  1. Merge pull request #199 from thorn0/patch-1

    mishoo committed Aug 15, 2011
    Compatibility with the JScript engine, which doesn't support \v
  2. more fixes:

    mishoo committed Aug 15, 2011
    - fixed a bug in ast_lift_variables (it took assignments from defun-s too)
    
    - keep order of inner defuns
    
    - always merge previous statement into `return`
    
    - disable turning `if (...) return; ...` into `if (!...) {...}` (adds 1K to
      jQuery; besides, `return` is not so bad after gzip)
    
    - run the mangler twice; the reason is that prepare_ifs does some
      optimizations that the mangler can benefit from, then the mangler does
      other optimizations that prepare_ifs can benefit from.  Fixes #191.
    
    We now beat Closure on jQuery by 1318 bytes (674 after gzip) and we're 6
    times faster.
Commits on Aug 14, 2011
  1. Easy yet safe optimization. Saves 119b on jQuery.

    mishoo committed Aug 14, 2011
        { foo(); return bar(); } => return foo(),bar();
    
    In many cases there's a single statement before `return' (since we join
    consecutive statements into a sequence), therefore applying this small step
    allows us to discard the brackets completely.  Similar for `throw'.
  2. more solid check need of semicolons after the last statement of a block.

    mishoo committed Aug 14, 2011
    small cleanup in gen_code (using ast_walker now).
    
    (fixes #184, #198)
  3. minor

    mishoo committed Aug 14, 2011
Commits on Aug 12, 2011
Commits on Aug 3, 2011
  1. attempt to group assignments into the var declaration

    mishoo committed Aug 3, 2011
    added --lift-vars to bin/uglifyjs options
Commits on Jul 29, 2011
  1. Added ast_lift_variables, which does a little more than its name says:

    mishoo committed Jul 29, 2011
    - move all var declarations to the top of the scope
    - drops redundant var declarations
    - removes unused function arguments
    - removes unreferenced inner functions
    
    It's commented out for now in bin/uglifyjs.  It seems safe, but however the
    generated code is a bit longer.  That's mainly because:
    
        var a = 1, b = 2, c = 3;
    
    becomes:
    
        var a, b, c;
        a = 1, b = 2, c = 3;
    
    I will improve on this.
Commits on Jul 18, 2011
Commits on Jul 14, 2011
  1. version 1.0.6

    mishoo committed Jul 14, 2011
  2. Merge pull request #179 from eirikurn/master

    mishoo committed Jul 14, 2011
    Regression regarding "with" statements in 1.0.4 and 1.0.5
  3. Merge pull request #177 from mathiasbynens/master

    mishoo committed Jul 14, 2011
    Only a subset of space characters is problematic after `</script`, so use `[\t\n\f\r ]` instead of `\s`.