UglifyJS.git
11 years agoReset the base54 counters every time minify is called.
Mihai Bazon [Fri, 28 Jun 2013 07:08:13 +0000 (10:08 +0300)]
Reset the base54 counters every time minify is called.

Close #229

11 years agoDon't swap binary ops when "use asm" is in effect.
Mihai Bazon [Fri, 7 Jun 2013 09:51:23 +0000 (12:51 +0300)]
Don't swap binary ops when "use asm" is in effect.

Refs #167

11 years agoMerge pull request #220 from lautis/escape-null
Mihai Bazon [Mon, 3 Jun 2013 18:10:14 +0000 (11:10 -0700)]
Merge pull request #220 from lautis/escape-null

Escape null characters as \x00

11 years agoEscape null characters as \x00
Ville Lautanala [Mon, 3 Jun 2013 17:18:42 +0000 (20:18 +0300)]
Escape null characters as \x00

Since \0 might be mistakenly interpreted as octal if followed by a
number and using literal null is in some cases interpreted as end of
string, escape null as \x00.

11 years agov2.3.6
Mihai Bazon [Thu, 23 May 2013 20:42:32 +0000 (23:42 +0300)]
v2.3.6

11 years agoMerge pull request #213 from mattrobenolt/patch-1
Mihai Bazon [Wed, 22 May 2013 18:30:54 +0000 (11:30 -0700)]
Merge pull request #213 from mattrobenolt/patch-1

SourceMapping pragma has changed to //#

11 years agoAdd `negate_iife` option to the code generator.
Mihai Bazon [Wed, 22 May 2013 18:22:14 +0000 (21:22 +0300)]
Add `negate_iife` option to the code generator.

See discussion in a9511dfbe5c0d96d8cacb87582aa9a19737bbb98

11 years agoSet "global" on undeclared SymbolDef-s
Mihai Bazon [Wed, 22 May 2013 10:08:19 +0000 (13:08 +0300)]
Set "global" on undeclared SymbolDef-s

11 years agoThe extra /* */ isn't needed now
Matt Robenolt [Tue, 21 May 2013 14:50:21 +0000 (08:50 -0600)]
The extra /* */ isn't needed now

11 years agoSourceMapping pragma has changed to //#
Matt Robenolt [Tue, 21 May 2013 14:46:27 +0000 (08:46 -0600)]
SourceMapping pragma has changed to //#

See: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit

The spec was updated on May 16th since `//@` was causing some issues with IE.

11 years agoFix output of statement: `new function(){...};`
Mihai Bazon [Mon, 20 May 2013 05:27:37 +0000 (08:27 +0300)]
Fix output of statement: `new function(){...};`

Close #209

11 years agov2.3.5
Mihai Bazon [Sun, 19 May 2013 11:25:05 +0000 (14:25 +0300)]
v2.3.5

11 years agoFix package.json (use `repository` instead of `repositories`)
Mihai Bazon [Sun, 19 May 2013 11:24:33 +0000 (14:24 +0300)]
Fix package.json (use `repository` instead of `repositories`)

11 years agov2.3.4
Mihai Bazon [Wed, 15 May 2013 10:27:40 +0000 (13:27 +0300)]
v2.3.4

11 years agoAdd `--expr`, an option to parse a single expression (suitable for JSON)
Mihai Bazon [Wed, 15 May 2013 10:27:23 +0000 (13:27 +0300)]
Add `--expr`, an option to parse a single expression (suitable for JSON)

11 years agoOnly compress code in `new Function` if all arguments are strings.
Mihai Bazon [Tue, 14 May 2013 15:36:31 +0000 (18:36 +0300)]
Only compress code in `new Function` if all arguments are strings.

11 years agov2.3.3
Mihai Bazon [Tue, 14 May 2013 08:33:28 +0000 (11:33 +0300)]
v2.3.3

11 years agoCompress code passed to `new Function` if it's a constant.
Mihai Bazon [Tue, 14 May 2013 07:47:06 +0000 (10:47 +0300)]
Compress code passed to `new Function` if it's a constant.

Only for `--unsafe`.

Close #203

11 years agoFix a["1_1"]
Mihai Bazon [Tue, 14 May 2013 07:41:28 +0000 (10:41 +0300)]
Fix a["1_1"]

Close #204

11 years agoMerge pull request #202 from nschonni/add-travis-ci
Mihai Bazon [Fri, 10 May 2013 09:56:24 +0000 (02:56 -0700)]
Merge pull request #202 from nschonni/add-travis-ci

Add CI build for supported Node versions

11 years agov2.3.2
Mihai Bazon [Thu, 9 May 2013 05:58:55 +0000 (08:58 +0300)]
v2.3.2

11 years agoUse the negation hack rather than parens for a toplevel function expression call
Mihai Bazon [Thu, 9 May 2013 05:58:47 +0000 (08:58 +0300)]
Use the negation hack rather than parens for a toplevel function expression call

(only in !beautify mode)

11 years agoFix is_assignable
Mihai Bazon [Thu, 9 May 2013 05:44:24 +0000 (08:44 +0300)]
Fix is_assignable

(not likely to be noticed, it's only used in `strict` parse mode)

11 years agoAdd Travis build badge to README
Nick Schonning [Thu, 9 May 2013 03:48:12 +0000 (23:48 -0400)]
Add Travis build badge to README

11 years agoAdd CI build for supported Node versions
Nick Schonning [Thu, 9 May 2013 03:42:06 +0000 (23:42 -0400)]
Add CI build for supported Node versions

11 years agoadd a test for zero-length string in is_identifier_string, which is used in property...
Trey Griffith [Wed, 8 May 2013 19:29:46 +0000 (15:29 -0400)]
add a test for zero-length string in is_identifier_string, which is used in property compression. Also added a test exercising the change.

11 years agoFix property names
Mihai Bazon [Wed, 8 May 2013 19:37:48 +0000 (22:37 +0300)]
Fix property names

Close #199

11 years agov2.3.1
Mihai Bazon [Wed, 8 May 2013 13:45:36 +0000 (16:45 +0300)]
v2.3.1

11 years agoBetter fix for equality of typeof ... against "undefined"
Mihai Bazon [Wed, 8 May 2013 13:22:39 +0000 (16:22 +0300)]
Better fix for equality of typeof ... against "undefined"

11 years agoFixed typeof undefined optimization and updated related test case to
Justin Lau [Sun, 5 May 2013 12:38:32 +0000 (20:38 +0800)]
Fixed typeof undefined optimization and updated related test case to
accomodates the sort behaviour changes made in commit
mishoo/UglifyJS2@aebafad41eab48f43ed649ce8c77e8f1528b50da.
Signed-off-by: Justin Lau <justin@tclau.com>
11 years agoAdded test cases for #104.
Justin Lau [Sun, 5 May 2013 11:54:27 +0000 (19:54 +0800)]
Added test cases for #104.
Signed-off-by: Justin Lau <justin@tclau.com>
11 years agoMerge pull request #195 from kjbekkelund/typo
Mihai Bazon [Wed, 8 May 2013 12:51:52 +0000 (05:51 -0700)]
Merge pull request #195 from kjbekkelund/typo

Fix typo in bin and readme

11 years agoFixed dot properties not optimizing unicode identifiers. Signed-off-by: Justin Lau...
Justin Lau [Sun, 5 May 2013 18:45:41 +0000 (02:45 +0800)]
Fixed dot properties not optimizing unicode identifiers. Signed-off-by: Justin Lau <justin@tclau.com>

11 years agoAdded test scenario with unicode in properties name.
Justin Lau [Sun, 5 May 2013 17:26:33 +0000 (01:26 +0800)]
Added test scenario with unicode in properties name.
Signed-off-by: Justin Lau <justin@tclau.com>
11 years agoFixed dot property issue with invlid identifier names.
Justin Lau [Sun, 5 May 2013 14:27:43 +0000 (22:27 +0800)]
Fixed dot property issue with invlid identifier names.
Signed-off-by: Justin Lau <justin@tclau.com>
11 years agoAdded scenario in test case where properties shouldn't be accessed with
Justin Lau [Sun, 5 May 2013 14:08:13 +0000 (22:08 +0800)]
Added scenario in test case where properties shouldn't be accessed with
dotted syntax even with screw_ie8 option.
Signed-off-by: Justin Lau <justin@tclau.com>
11 years agoFix typo in bin and readme
Kim Joar Bekkelund [Thu, 2 May 2013 09:15:33 +0000 (11:15 +0200)]
Fix typo in bin and readme

11 years agoMerge pull request #194 from ulikoehler/master
Mihai Bazon [Wed, 1 May 2013 14:04:01 +0000 (07:04 -0700)]
Merge pull request #194 from ulikoehler/master

Add README syntax highlighting

11 years agoAdd README syntax highlighting
Uli Köhler [Wed, 1 May 2013 13:56:20 +0000 (15:56 +0200)]
Add README syntax highlighting

11 years agoTake two. v2.3.0
Mihai Bazon [Wed, 1 May 2013 10:15:34 +0000 (13:15 +0300)]
Take two.  v2.3.0

11 years agov2.3
Mihai Bazon [Wed, 1 May 2013 10:14:07 +0000 (13:14 +0300)]
v2.3

11 years agoWorkaround for missing `prefix` in UnaryExpression generated by Esprima
Mihai Bazon [Mon, 29 Apr 2013 12:03:52 +0000 (15:03 +0300)]
Workaround for missing `prefix` in UnaryExpression generated by Esprima

See #193

11 years agoMake compress/mangle disabled by default, as before 5af144522a6fea302abdd0b63d48864de...
Mihai Bazon [Sun, 21 Apr 2013 08:35:50 +0000 (11:35 +0300)]
Make compress/mangle disabled by default, as before 5af144522a6fea302abdd0b63d48864de0664207

11 years agoMerge pull request #191 from michaelficarra/use-es5-member-access-with-screw-ie
Mihai Bazon [Sun, 21 Apr 2013 08:30:02 +0000 (01:30 -0700)]
Merge pull request #191 from michaelficarra/use-es5-member-access-with-screw-ie

use dotted member access when --screw-ie8 option given

11 years agoMerge pull request #190 from michaelficarra/patch-1
Mihai Bazon [Sun, 21 Apr 2013 08:28:45 +0000 (01:28 -0700)]
Merge pull request #190 from michaelficarra/patch-1

unbalanced parentheses in readme

11 years agofixes #189: use dotted member access when --screw-ie8 option given
Michael Ficarra [Sat, 20 Apr 2013 20:11:05 +0000 (15:11 -0500)]
fixes #189: use dotted member access when --screw-ie8 option given

11 years agounbalanced parentheses in readme
Michael Ficarra [Sat, 20 Apr 2013 19:05:52 +0000 (14:05 -0500)]
unbalanced parentheses in readme

11 years agoFix typeof evaluation for regex and function
Roman Bataev [Thu, 4 Apr 2013 02:34:38 +0000 (22:34 -0400)]
Fix typeof evaluation for regex and function

11 years agoAdd tests for typeof evaluation
Roman Bataev [Thu, 4 Apr 2013 02:34:19 +0000 (22:34 -0400)]
Add tests for typeof evaluation

11 years agoQuote objects with numeric keys
Vladimir Zhuravlev [Sun, 31 Mar 2013 13:55:11 +0000 (20:55 +0700)]
Quote objects with numeric keys

11 years agofix package.json
Mihai Bazon [Sun, 31 Mar 2013 10:38:02 +0000 (13:38 +0300)]
fix package.json

11 years agoDon't use \xYY for identifiers
Mihai Bazon [Sun, 31 Mar 2013 10:35:29 +0000 (13:35 +0300)]
Don't use \xYY for identifiers

Fix #173

11 years agoOutput, to_ascii: Escape non-ascii chars with \xnn instead of \unnnn whenever possible.
Andreas Lind Petersen [Sun, 31 Mar 2013 09:07:31 +0000 (11:07 +0200)]
Output, to_ascii: Escape non-ascii chars with \xnn instead of \unnnn whenever possible.

11 years agouglifyjs binary: Make read_whole_file async and don't attempt to read STDIN synchrono...
Andreas Lind Petersen [Sun, 31 Mar 2013 09:51:43 +0000 (11:51 +0200)]
uglifyjs binary: Make read_whole_file async and don't attempt to read STDIN synchronously.

11 years agoMerge pull request #163 from mzgol/screw-oldie
Mihai Bazon [Mon, 25 Mar 2013 16:05:44 +0000 (09:05 -0700)]
Merge pull request #163 from mzgol/screw-oldie

renamed --screw-ie to --screw-oldie, documented it in README.md, indicat...

11 years agorenamed --screw-ie to --screw-ie8, documented it in README.md, indicated it doesn...
Michał Gołębiowski [Mon, 25 Mar 2013 15:11:07 +0000 (16:11 +0100)]
renamed --screw-ie to --screw-ie8, documented it in README.md, indicated it doesn't break IE9+

11 years agoAdd support for enclose option. Closes #139.
Jake Harding [Fri, 1 Mar 2013 05:21:14 +0000 (21:21 -0800)]
Add support for enclose option. Closes #139.

11 years agoDon't print the warning on parse error, just throw a JS_Parse_Error.
Mihai Bazon [Sat, 23 Mar 2013 22:57:35 +0000 (00:57 +0200)]
Don't print the warning on parse error, just throw a JS_Parse_Error.

Fix #159

11 years agoKeep legit code working even when --screw-ie is not passed.
Mihai Bazon [Fri, 22 Mar 2013 16:02:08 +0000 (18:02 +0200)]
Keep legit code working even when --screw-ie is not passed.

Previously:

    Without `--screw-ie`, UglifyJS would always leak names of function
    expressions into the containing scope, as if they were function
    declarations.  That was to emulate IE<9 behavior.  Code relying on this
    IE bug would continue to work properly after mangling, although it would
    only work in IE (since other engines don't share the bug).  Sometimes
    this broke legitimage code (see #153 and #155).

    With `--screw-ie` the names would not be leaked into the current scope,
    working properly in legit cases; but still it broke legit code when
    running in IE<9 (see #24).

Currently:

    Regardless of the `--screw-ie` setting, the names will not be leaked.
    Code relying on the IE bug will not work properly after mangling.
    <evil laughter here>

    Without `--screw-ie`: a hack has been added to the mangler to avoid
    using the same name for a function expression and some other variable in
    the same scope.  This keeps legit code working, at the (negligible,
    indeed) cost of one more identifier.

    With `--screw-ie` you allow the mangler to name function expressions
    with the same identifier as another variable in scope.  After mangling
    code might break in IE<9.

Oh man, the commit message is longer than the patch.

Fix #153, #155

11 years agoMerge pull request #125 from devongovett/master
Mihai Bazon [Wed, 13 Mar 2013 08:36:55 +0000 (01:36 -0700)]
Merge pull request #125 from devongovett/master

Allow inSourceMap option to be a generated JSON source map

11 years agoSupport mangling toplevel names
Mihai Bazon [Wed, 13 Mar 2013 07:44:06 +0000 (09:44 +0200)]
Support mangling toplevel names

Close #127

11 years agoDisable `unsafe` by default
Mihai Bazon [Sun, 10 Mar 2013 22:04:31 +0000 (00:04 +0200)]
Disable `unsafe` by default

Close #147

11 years agoMerge pull request #146 from mbostock/read-all-stdin
Mihai Bazon [Wed, 6 Mar 2013 06:17:09 +0000 (22:17 -0800)]
Merge pull request #146 from mbostock/read-all-stdin

Read the entire STDIN.

11 years agoRead the entire STDIN.
Mike Bostock [Wed, 6 Mar 2013 04:35:49 +0000 (20:35 -0800)]
Read the entire STDIN.

The problem with reading synchronously from /dev/stdin is that you can get a
spurious EOF when the input buffer is empty, even if more content is coming. Now
STDIN is read from a loop, and only stops polling when all input has been read.
This fixes #70 #85 and other errors related to parsing large files on STDIN.

11 years agoFix reordering comparisons
Mihai Bazon [Mon, 4 Mar 2013 08:06:01 +0000 (10:06 +0200)]
Fix reordering comparisons

Close #143

11 years agoAdd `--screw-ie` option
Mihai Bazon [Sat, 2 Mar 2013 12:28:34 +0000 (14:28 +0200)]
Add `--screw-ie` option

For now the implication is that UglifyJS will not leak a function
expression's name in the surrounding scope (IE < 9 does that).

(ref. mishoo/UglifyJS#485)

11 years agoDrop last `default:` if it's the last branch and empty
Mihai Bazon [Fri, 1 Mar 2013 11:12:03 +0000 (13:12 +0200)]
Drop last `default:` if it's the last branch and empty

Close #141

11 years agoCompress boolean constants after evaluation
Mihai Bazon [Fri, 1 Mar 2013 08:26:06 +0000 (10:26 +0200)]
Compress boolean constants after evaluation

Close #137

11 years agoAdd license
Mihai Bazon [Fri, 22 Feb 2013 11:58:16 +0000 (13:58 +0200)]
Add license

Close #131

11 years agoFix compressing `do {...} while (false)`
Mihai Bazon [Tue, 19 Feb 2013 16:12:19 +0000 (18:12 +0200)]
Fix compressing `do {...} while (false)`

It's not safe to transform it to {...} because the body might contain
`break`.  The solution could be more elaborate (detect if body contains
`break`) but I don't think it's worth the trouble.

Close #129

11 years agov2.2.5
Mihai Bazon [Thu, 14 Feb 2013 10:51:13 +0000 (12:51 +0200)]
v2.2.5

11 years agoAllow inSourceMap to be a generated JSON source map instead of just a file name
Devon Govett [Sun, 10 Feb 2013 18:06:13 +0000 (10:06 -0800)]
Allow inSourceMap to be a generated JSON source map instead of just a file name

11 years agoForce space after literal regexp when used in "instanceof" or "in"
Mihai Bazon [Wed, 6 Feb 2013 09:57:59 +0000 (11:57 +0200)]
Force space after literal regexp when used in "instanceof" or "in"

Close #118

11 years agoGive up evaluating (unary-prefix '-' 0)
Mihai Bazon [Wed, 6 Feb 2013 09:51:09 +0000 (11:51 +0200)]
Give up evaluating (unary-prefix '-' 0)

Close #117

------

    JS, WHY YOU SUCK SO BADLY? ;-(

11 years agoFix parens for NaN
Mihai Bazon [Wed, 6 Feb 2013 09:38:29 +0000 (11:38 +0200)]
Fix parens for NaN

Close #116

11 years agoFix parens for negative numbers
Mihai Bazon [Wed, 6 Feb 2013 09:36:04 +0000 (11:36 +0200)]
Fix parens for negative numbers

Close #115

11 years agoFix parens for AST_New
Mihai Bazon [Wed, 6 Feb 2013 09:28:49 +0000 (11:28 +0200)]
Fix parens for AST_New

Close #114

11 years agoFix handling of constants
Mihai Bazon [Wed, 6 Feb 2013 09:15:31 +0000 (11:15 +0200)]
Fix handling of constants

Close #113

11 years agoUgly hack to print comments before return/throw statements
Mihai Bazon [Tue, 5 Feb 2013 17:10:33 +0000 (19:10 +0200)]
Ugly hack to print comments before return/throw statements

Close #112

11 years agoMerge pull request #111 from mattrobenolt/safer-sourcemap
Mihai Bazon [Mon, 4 Feb 2013 07:44:31 +0000 (23:44 -0800)]
Merge pull request #111 from mattrobenolt/safer-sourcemap

Wraps sourceMappingURL in a multiline comment. Fixes #108

11 years agoWraps sourceMappingURL in a multiline comment. Fixes #108
Matt Robenolt [Mon, 4 Feb 2013 00:01:01 +0000 (16:01 -0800)]
Wraps sourceMappingURL in a multiline comment. Fixes #108

11 years agov2.2.4
Mihai Bazon [Fri, 1 Feb 2013 11:31:28 +0000 (13:31 +0200)]
v2.2.4

11 years agoFix end token for Assign nodes
Mihai Bazon [Sat, 26 Jan 2013 12:24:54 +0000 (14:24 +0200)]
Fix end token for Assign nodes

11 years agoMerge pull request #94 from paulmillr/patch-1
Mihai Bazon [Fri, 1 Feb 2013 07:50:59 +0000 (23:50 -0800)]
Merge pull request #94 from paulmillr/patch-1

Add better fromstring docs.

11 years agoMerge pull request #106 from gibson042/105
Mihai Bazon [Thu, 24 Jan 2013 13:51:33 +0000 (05:51 -0800)]
Merge pull request #106 from gibson042/105

Fix #105: property comparison to undefined is not always safe

11 years agoFix #105: property comparison to undefined is not always safe
Richard Gibson [Thu, 24 Jan 2013 04:52:04 +0000 (23:52 -0500)]
Fix #105: property comparison to undefined is not always safe

11 years agoAdd --source-map-url option
Mihai Bazon [Sun, 20 Jan 2013 10:32:07 +0000 (12:32 +0200)]
Add --source-map-url option

Fix #100
Fix #47

11 years ago[AST_Hole] the print function can be a no-op.
Mihai Bazon [Thu, 17 Jan 2013 09:16:55 +0000 (11:16 +0200)]
[AST_Hole] the print function can be a no-op.

11 years agoFix output for arrays containing undefined values.
David Glasser [Wed, 16 Jan 2013 19:59:19 +0000 (14:59 -0500)]
Fix output for arrays containing undefined values.

1b6bcca7 was a first attempt at this. That commit made Uglify stop replacing
holes with undefined, but instead it started replacing undefined with
holes. This is slightly problematic, because there is a difference between a
hole and an undefined value. More problematically, it changed [1,undefined] to
[1,] which generally doesn't even parse as a hole (just as a trailing comma), so
it didn't even preserve the length of the array!

Instead, parse holes as their own special AST node which prints invisibly.

11 years agoMerge pull request #98 from ForbesLindesay/patch-1
Mihai Bazon [Thu, 17 Jan 2013 09:08:59 +0000 (01:08 -0800)]
Merge pull request #98 from ForbesLindesay/patch-1

Update installation instructions

11 years agoHandle String() with no arguments.
Mihai Bazon [Thu, 17 Jan 2013 09:01:38 +0000 (11:01 +0200)]
Handle String() with no arguments.

Fix #91

11 years agoUpdate installation instructions re #4
Forbes Lindesay [Thu, 17 Jan 2013 00:13:42 +0000 (00:13 +0000)]
Update installation instructions re #4

11 years agoAdd better fromstring docs.
Paul Miller [Sun, 13 Jan 2013 16:45:43 +0000 (18:45 +0200)]
Add better fromstring docs.

11 years agoMerge pull request #90 from jakearchibald/patch-1
Mihai Bazon [Tue, 8 Jan 2013 22:21:25 +0000 (14:21 -0800)]
Merge pull request #90 from jakearchibald/patch-1

Compressor options use underscores rather than hyphens

11 years agoCompressor options use underscores rather than hyphens
Jake Archibald [Tue, 8 Jan 2013 20:33:58 +0000 (12:33 -0800)]
Compressor options use underscores rather than hyphens

11 years agov2.2.3
Mihai Bazon [Fri, 4 Jan 2013 20:50:53 +0000 (22:50 +0200)]
v2.2.3

11 years agoFix handling of labels in nested scopes
Mihai Bazon [Fri, 4 Jan 2013 12:17:33 +0000 (14:17 +0200)]
Fix handling of labels in nested scopes

11 years agoSupport `output`, `mangle` and `compress` options to `UglifyJS.minify`.
Mihai Bazon [Fri, 4 Jan 2013 09:24:29 +0000 (11:24 +0200)]
Support `output`, `mangle` and `compress` options to `UglifyJS.minify`.

Close #57
Close #86
Close #33

11 years agoMerge pull request #87 from BenoitZugmeyer/master
Mihai Bazon [Thu, 3 Jan 2013 10:28:35 +0000 (02:28 -0800)]
Merge pull request #87 from BenoitZugmeyer/master

Add a --version option

11 years agoSet --version as a boolean #87
Benoît Zugmeyer [Thu, 3 Jan 2013 10:22:37 +0000 (11:22 +0100)]
Set --version as a boolean #87