UglifyJS.git
10 years agoMangle name of exception when --screw-ie8. Fix #430.
Mihai Bazon [Fri, 14 Feb 2014 11:58:14 +0000 (13:58 +0200)]
Mangle name of exception when --screw-ie8.  Fix #430.

The effect of not mangling it was visible only with --screw-ie8 (otherwise
the names would be mangled exactly because they leaked into the parent
scope).

10 years agoAdd option `keep_fargs`.
Mihai Bazon [Sat, 8 Feb 2014 10:33:56 +0000 (12:33 +0200)]
Add option `keep_fargs`.

By default it's `false`.  Pass `true` if you need to keep unused function
arguments.

Close #188.

10 years agoMerge pull request #424 from mattbasta/simplify_conditionals
Mihai Bazon [Fri, 7 Feb 2014 09:31:11 +0000 (11:31 +0200)]
Merge pull request #424 from mattbasta/simplify_conditionals

Simplify nested conditionals if possible

10 years agoSimplify nested conditionals if possible
Matt Basta [Thu, 6 Feb 2014 20:39:13 +0000 (12:39 -0800)]
Simplify nested conditionals if possible

10 years agoMerge pull request #422 from mourner/patch-1
Mihai Bazon [Thu, 6 Feb 2014 16:13:10 +0000 (18:13 +0200)]
Merge pull request #422 from mourner/patch-1

Fix readme typo (when -> with)

10 years agofix readme typo (when -> with)
Vladimir Agafonkin [Thu, 6 Feb 2014 16:11:33 +0000 (18:11 +0200)]
fix readme typo (when -> with)

10 years agoFix if_return dropping the alternative. Close #413
Mihai Bazon [Fri, 31 Jan 2014 08:44:13 +0000 (10:44 +0200)]
Fix if_return dropping the alternative.  Close #413

10 years agoUpdate source-map
Mihai Bazon [Sun, 26 Jan 2014 08:18:20 +0000 (10:18 +0200)]
Update source-map

10 years agoMerge branch 'sourcesContent' of https://github.com/arty-name/UglifyJS2 into arty...
Mihai Bazon [Sun, 26 Jan 2014 08:15:24 +0000 (10:15 +0200)]
Merge branch 'sourcesContent' of https://github.com/arty-name/UglifyJS2 into arty-name-sourcesContent

10 years agov2.4.12
Mihai Bazon [Sun, 26 Jan 2014 08:11:00 +0000 (10:11 +0200)]
v2.4.12

10 years agoMerge branch 'master' of github.com:mishoo/UglifyJS2
Mihai Bazon [Sun, 26 Jan 2014 08:07:10 +0000 (10:07 +0200)]
Merge branch 'master' of github.com:mishoo/UglifyJS2

10 years agoMerge pull request #408 from danielstutzman/escape-null-in-regex
Mihai Bazon [Sun, 26 Jan 2014 08:06:19 +0000 (00:06 -0800)]
Merge pull request #408 from danielstutzman/escape-null-in-regex

Don't unescape \x00 in regexes (it breaks IE8)

10 years agoMove unescaping regexps under a codegen option (`unescape_regexps`)
Mihai Bazon [Sun, 26 Jan 2014 08:05:55 +0000 (10:05 +0200)]
Move unescaping regexps under a codegen option (`unescape_regexps`)

10 years agoDon't unescape \x00 in regexes (it breaks IE8)
Daniel Stutzman [Sat, 25 Jan 2014 18:55:39 +0000 (11:55 -0700)]
Don't unescape \x00 in regexes (it breaks IE8)

10 years agov2.4.11
Mihai Bazon [Tue, 21 Jan 2014 09:44:28 +0000 (11:44 +0200)]
v2.4.11

10 years agoMore chars that cannot be unescaped in regexps.
Mihai Bazon [Tue, 21 Jan 2014 09:44:00 +0000 (11:44 +0200)]
More chars that cannot be unescaped in regexps.

10 years agoFix end token for conditionals. Close #404
Mihai Bazon [Tue, 21 Jan 2014 08:38:59 +0000 (10:38 +0200)]
Fix end token for conditionals.  Close #404

10 years agoMerge pull request #402 from lautis/bom-regexps
Mihai Bazon [Sun, 19 Jan 2014 14:14:12 +0000 (06:14 -0800)]
Merge pull request #402 from lautis/bom-regexps

Don't unescape byte order marks in regexps

10 years agoDon't unescape byte order marks in regexps
Ville Lautanala [Sun, 19 Jan 2014 10:27:03 +0000 (12:27 +0200)]
Don't unescape byte order marks in regexps

10 years agov2.4.10
Mihai Bazon [Sat, 18 Jan 2014 10:32:45 +0000 (12:32 +0200)]
v2.4.10

10 years agoDon't unescape \x2f (slash) in regexps. #54
Mihai Bazon [Sat, 18 Jan 2014 10:31:50 +0000 (12:31 +0200)]
Don't unescape \x2f (slash) in regexps.  #54

10 years agoFix example
Mihai Bazon [Fri, 17 Jan 2014 13:48:47 +0000 (15:48 +0200)]
Fix example

10 years agov2.4.9
Mihai Bazon [Wed, 15 Jan 2014 20:31:09 +0000 (22:31 +0200)]
v2.4.9

10 years agosimplify
Mihai Bazon [Fri, 10 Jan 2014 08:36:15 +0000 (10:36 +0200)]
simplify

10 years agoUnescape Unicode sequences in regexps when ascii_only is false. #54
Mihai Bazon [Fri, 10 Jan 2014 08:33:58 +0000 (10:33 +0200)]
Unescape Unicode sequences in regexps when ascii_only is false.  #54

10 years agoadded hasOwnProperty check to avoid warnings
Artemy Tregubenko [Thu, 9 Jan 2014 14:20:05 +0000 (15:20 +0100)]
added hasOwnProperty check to avoid warnings

10 years agoAdded support for sourcesContent property of source map
Artemy Tregubenko [Thu, 9 Jan 2014 14:12:00 +0000 (15:12 +0100)]
Added support for sourcesContent property of source map

10 years agoBetter process_for_angular before other statement reductions. #395
Mihai Bazon [Wed, 8 Jan 2014 09:39:24 +0000 (11:39 +0200)]
Better process_for_angular before other statement reductions.  #395

10 years agoSupport @ngInject with `angular` compressor option. Close #395.
Mihai Bazon [Wed, 8 Jan 2014 09:28:32 +0000 (11:28 +0200)]
Support @ngInject with `angular` compressor option.  Close #395.

10 years agoDisable node 0.6 since the build fails consistently and it's not our fault.
Mihai Bazon [Tue, 7 Jan 2014 16:56:18 +0000 (18:56 +0200)]
Disable node 0.6 since the build fails consistently and it's not our fault.

10 years agoSupport SpiderMonkey AST in UglifyJS.minify. Fix #393.
Mihai Bazon [Tue, 7 Jan 2014 16:42:48 +0000 (18:42 +0200)]
Support SpiderMonkey AST in UglifyJS.minify.  Fix #393.

10 years agodoh.
Mihai Bazon [Tue, 7 Jan 2014 10:54:14 +0000 (12:54 +0200)]
doh.

10 years agoFix #392
Mihai Bazon [Tue, 7 Jan 2014 10:48:54 +0000 (12:48 +0200)]
Fix #392

10 years agominor: exp["10"] => exp[10]
Mihai Bazon [Tue, 7 Jan 2014 10:48:21 +0000 (12:48 +0200)]
minor: exp["10"] => exp[10]

10 years agoFix parens for property access -- (foo, bar)["baz"]
Mihai Bazon [Sun, 5 Jan 2014 09:48:01 +0000 (11:48 +0200)]
Fix parens for property access -- (foo, bar)["baz"]

10 years agoConditional/call optimization
Mihai Bazon [Sun, 29 Dec 2013 08:31:30 +0000 (10:31 +0200)]
Conditional/call optimization

   foo ? bar(x) : bar(y)  ==>  bar(foo ? x : y)

10 years agoMark `yield` as reserved word. Close #375.
Mihai Bazon [Sun, 22 Dec 2013 18:52:19 +0000 (20:52 +0200)]
Mark `yield` as reserved word.  Close #375.

10 years agoOptimize seq,void 0. Close #377.
Mihai Bazon [Sun, 22 Dec 2013 09:36:45 +0000 (11:36 +0200)]
Optimize seq,void 0.  Close #377.

    (x, void 0)    => void x
    (x, undefined) => void x

10 years agoBetter fix for comments in AST_Exit
Mihai Bazon [Wed, 18 Dec 2013 13:54:12 +0000 (15:54 +0200)]
Better fix for comments in AST_Exit

Close #374

10 years agoTake out all comments from an AST_Exit's value
Mihai Bazon [Wed, 18 Dec 2013 11:30:26 +0000 (13:30 +0200)]
Take out all comments from an AST_Exit's value

Fix #372

10 years agov2.4.8
Mihai Bazon [Wed, 18 Dec 2013 10:10:43 +0000 (12:10 +0200)]
v2.4.8

10 years agoAdd option to adjust the src/target line in the source map
Mihai Bazon [Wed, 18 Dec 2013 10:10:02 +0000 (12:10 +0200)]
Add option to adjust the src/target line in the source map

10 years agominor
Mihai Bazon [Mon, 16 Dec 2013 18:37:09 +0000 (20:37 +0200)]
minor

10 years agoMerge pull request #371 from colorhook/master
Mihai Bazon [Mon, 16 Dec 2013 08:21:07 +0000 (00:21 -0800)]
Merge pull request #371 from colorhook/master

bugfix #242

10 years agobugfix #242
colorhook [Mon, 16 Dec 2013 07:53:43 +0000 (15:53 +0800)]
bugfix #242

10 years agosemicolons
Mihai Bazon [Tue, 10 Dec 2013 18:24:27 +0000 (20:24 +0200)]
semicolons

10 years agoMerge pull request #245 from ForbesLindesay/patch-1
Mihai Bazon [Tue, 10 Dec 2013 18:23:29 +0000 (10:23 -0800)]
Merge pull request #245 from ForbesLindesay/patch-1

Make `DefaultsError` a real `Error` object

10 years agoAdd `drop_console` option to the compressor
Mihai Bazon [Tue, 10 Dec 2013 17:44:41 +0000 (19:44 +0200)]
Add `drop_console` option to the compressor

10 years agominor
Mihai Bazon [Tue, 10 Dec 2013 17:39:03 +0000 (19:39 +0200)]
minor

10 years agov2.4.7
Mihai Bazon [Mon, 9 Dec 2013 10:09:31 +0000 (12:09 +0200)]
v2.4.7

10 years agoAST_Catch shouldn't really inherit from AST_Scope. Fix #363
Mihai Bazon [Thu, 5 Dec 2013 11:30:29 +0000 (13:30 +0200)]
AST_Catch shouldn't really inherit from AST_Scope.  Fix #363

I hereby acknowledge that figure_out_scope has become a mess.

10 years agoProperly scope `catch` identifier when --screw-ie8
Mihai Bazon [Thu, 28 Nov 2013 14:43:30 +0000 (16:43 +0200)]
Properly scope `catch` identifier when --screw-ie8

Fix #344

10 years agov2.4.6, because npm is foobar
Mihai Bazon [Thu, 28 Nov 2013 13:05:32 +0000 (15:05 +0200)]
v2.4.6, because npm is foobar

10 years agov2.4.5
Mihai Bazon [Thu, 28 Nov 2013 11:15:27 +0000 (13:15 +0200)]
v2.4.5

10 years agoAdd --noerr to turn off argument name checking
Mihai Bazon [Thu, 28 Nov 2013 11:15:01 +0000 (13:15 +0200)]
Add --noerr to turn off argument name checking

for now only used for keys passed to `-c` or `-b`.

10 years agov2.4.4
Mihai Bazon [Wed, 27 Nov 2013 12:24:26 +0000 (14:24 +0200)]
v2.4.4

10 years agoFix faulty compression
Mihai Bazon [Wed, 20 Nov 2013 19:13:16 +0000 (21:13 +0200)]
Fix faulty compression

`String(x + 5)` is not always the same as `x + "5"`.  Overlooked that. :-(

Close #350

10 years agoOnly descend twice after drop_unused if it's the same node type.
Mihai Bazon [Fri, 8 Nov 2013 09:57:17 +0000 (11:57 +0200)]
Only descend twice after drop_unused if it's the same node type.

Fix #345

10 years agoBetter fix for #343
Mihai Bazon [Wed, 6 Nov 2013 08:47:36 +0000 (10:47 +0200)]
Better fix for #343

We can in fact lift sequences, but only if the operation is assignment and
the left-hand side has no side effects nor property access -- that should
guarantee that whatever we place before it cannot affect the sense of the
assignment.

Dropped contrived test case (too hard to support it now), added a more
meaningful one.

10 years agov2.4.3
Mihai Bazon [Wed, 6 Nov 2013 08:21:29 +0000 (10:21 +0200)]
v2.4.3

10 years agoDo not lift sequence from right-hand side of binary operation. Fix #343
Mihai Bazon [Wed, 6 Nov 2013 08:18:28 +0000 (10:18 +0200)]
Do not lift sequence from right-hand side of binary operation.  Fix #343

10 years agov2.4.2
Mihai Bazon [Sun, 3 Nov 2013 21:41:07 +0000 (23:41 +0200)]
v2.4.2

10 years ago[README] Fix #278
Mihai Bazon [Wed, 30 Oct 2013 12:13:10 +0000 (14:13 +0200)]
[README] Fix #278

10 years agoWorkaround for Safari bug
Mihai Bazon [Wed, 30 Oct 2013 11:59:59 +0000 (13:59 +0200)]
Workaround for Safari bug

Close #313

10 years agoFix parsing setters/getters (allow keywords for name).
Mihai Bazon [Wed, 30 Oct 2013 09:50:22 +0000 (11:50 +0200)]
Fix parsing setters/getters (allow keywords for name).

The "key" property was always "set" or "get", which didn't make much sense.
Now it'll be the actual name of the setter/getter (AST_Node), and the
AST_Accessor object itself, which represents the function, won't store any
name.

Close #319

10 years agoFix regression after e4c530240650535d1cb46569dfb013193471af05
Mihai Bazon [Wed, 30 Oct 2013 08:45:58 +0000 (10:45 +0200)]
Fix regression after e4c530240650535d1cb46569dfb013193471af05

`x * (y * z)` ==> `x * y * z` -- the better place to do this is in the
compressor rather than codegen.

10 years agoindentation
Mihai Bazon [Wed, 30 Oct 2013 08:44:50 +0000 (10:44 +0200)]
indentation

10 years agoFix output for `x = 2 * (a % b / b * c)`
Mihai Bazon [Wed, 30 Oct 2013 07:11:55 +0000 (09:11 +0200)]
Fix output for `x = 2 * (a % b / b * c)`

(issue #337)

10 years agominor
Mihai Bazon [Wed, 30 Oct 2013 07:10:56 +0000 (09:10 +0200)]
minor

10 years agoDisallow reversal where lhs has higher or equal precedence
Richard van Velzen [Tue, 29 Oct 2013 20:37:36 +0000 (21:37 +0100)]
Disallow reversal where lhs has higher or equal precedence

Fixes #267

10 years agoFix typo
Mihai Bazon [Tue, 29 Oct 2013 13:53:54 +0000 (15:53 +0200)]
Fix typo

10 years agoFix reading arguments
Mihai Bazon [Tue, 29 Oct 2013 12:01:26 +0000 (14:01 +0200)]
Fix reading arguments

i.e. read `-c unsafe,unsafe-comps` as `-c unsafe=true,unsafe_comps=true`

10 years agoAvoid shadowing name of function expression with function argument
Mihai Bazon [Tue, 29 Oct 2013 11:18:09 +0000 (13:18 +0200)]
Avoid shadowing name of function expression with function argument

Close #179, #326, #327

10 years agoAdd "preamble" output option
Mihai Bazon [Tue, 29 Oct 2013 08:43:43 +0000 (10:43 +0200)]
Add "preamble" output option

Close #335

10 years agoFix codegen for when comments_before is undefined.
Mihai Bazon [Mon, 28 Oct 2013 07:39:29 +0000 (09:39 +0200)]
Fix codegen for when comments_before is undefined.

Fix #333

10 years agoMerge branch 'master' of github.com:mishoo/UglifyJS2
Mihai Bazon [Sun, 27 Oct 2013 08:03:01 +0000 (10:03 +0200)]
Merge branch 'master' of github.com:mishoo/UglifyJS2

10 years agoDisplay number of failed tests and corresponding files
Mihai Bazon [Sun, 27 Oct 2013 08:02:44 +0000 (10:02 +0200)]
Display number of failed tests and corresponding files

10 years agoMerge pull request #330 from markjaquith/master
Mihai Bazon [Sun, 27 Oct 2013 08:01:57 +0000 (01:01 -0700)]
Merge pull request #330 from markjaquith/master

Unit test to detect issue in 8d14efe for #126 that causes aggressive parenthesis removal, functional differences

10 years agoMerge pull request #331 from rvanvelzen/rhs-strings-fix
Mihai Bazon [Sun, 27 Oct 2013 08:01:11 +0000 (01:01 -0700)]
Merge pull request #331 from rvanvelzen/rhs-strings-fix

Fix RHS concat (raised in #330)

10 years agoFix RHS concat (raised in #330)
Richard van Velzen [Sat, 26 Oct 2013 16:44:52 +0000 (18:44 +0200)]
Fix RHS concat (raised in #330)

When attempting to concat the left-side of the rhs, make sure the rhs is
a string.

10 years agoAdd a unit test for issue-126
Mark Jaquith [Fri, 25 Oct 2013 20:28:15 +0000 (16:28 -0400)]
Add a unit test for issue-126

Add a unit test to test to test for aggressive parenthesis removal that causes functional changes.

10 years agoMerge pull request #325 from rvanvelzen/fix-269
Mihai Bazon [Thu, 24 Oct 2013 09:39:07 +0000 (02:39 -0700)]
Merge pull request #325 from rvanvelzen/fix-269

Fix #269

10 years agoFix #269
Richard van Velzen [Thu, 24 Oct 2013 09:08:33 +0000 (11:08 +0200)]
Fix #269

Shorten most primitives where possible. Also optimize some edge cases.

10 years agoMerge pull request #323 from rvanvelzen/undefined-drop-vars-fix
Mihai Bazon [Wed, 23 Oct 2013 20:58:09 +0000 (13:58 -0700)]
Merge pull request #323 from rvanvelzen/undefined-drop-vars-fix

Fix #280

10 years agoFix #280
Richard van Velzen [Wed, 23 Oct 2013 20:26:04 +0000 (22:26 +0200)]
Fix #280

The `init` of the `ForStatement` is not a `BlockStatement` before it was
descended. The descend has to happen first, and *then* the actual
checks.

10 years agoMerge pull request #322 from rvanvelzen/test-exit-code-1
Mihai Bazon [Wed, 23 Oct 2013 18:37:36 +0000 (11:37 -0700)]
Merge pull request #322 from rvanvelzen/test-exit-code-1

Add an exit code to the test suite

10 years agoAdd an exit code to the test suite
Richard van Velzen [Wed, 23 Oct 2013 18:24:58 +0000 (20:24 +0200)]
Add an exit code to the test suite

By adding the exit code 1 (or any other non-zero exit code) `npm test`
will know the tests didn't perform correctly. This way it's easier to
know if pull requests are good or bad.

10 years agoRevert #3a81f60 for now
Mihai Bazon [Tue, 22 Oct 2013 18:49:33 +0000 (21:49 +0300)]
Revert #3a81f60 for now

(with it some tests break and it can generate invalid output, see issue #44)

10 years agov2.4.1
Mihai Bazon [Tue, 22 Oct 2013 18:31:01 +0000 (21:31 +0300)]
v2.4.1

10 years ago`arguments` outside of a function is an ordinary variable.
Mihai Bazon [Thu, 17 Oct 2013 15:20:33 +0000 (18:20 +0300)]
`arguments` outside of a function is an ordinary variable.

Fix #501

10 years agowrap up
Mihai Bazon [Wed, 9 Oct 2013 19:15:43 +0000 (22:15 +0300)]
wrap up

10 years agoDon't drop_unused before compression.
Mihai Bazon [Wed, 9 Oct 2013 16:15:09 +0000 (19:15 +0300)]
Don't drop_unused before compression.

Fix #280, #282

10 years agoRename clean_getters to pure_getters; add pure_funcs.
Mihai Bazon [Fri, 4 Oct 2013 10:17:25 +0000 (13:17 +0300)]
Rename clean_getters to pure_getters; add pure_funcs.

10 years agoMerge pull request #308 from meteor/fix-unicode-keys
Mihai Bazon [Fri, 4 Oct 2013 07:13:52 +0000 (00:13 -0700)]
Merge pull request #308 from meteor/fix-unicode-keys

Only allow identifier start characters at the beginning of identifiers.

10 years agoOnly allow identifier start characters at the beginning of identifiers.
David Glasser [Fri, 4 Oct 2013 00:02:19 +0000 (17:02 -0700)]
Only allow identifier start characters at the beginning of identifiers.

Without this fix, the following source:

   x = {"\u200c": 42};

would incorrectly be converted into a quoteless key. But while \u200c is allowed
to be in identifiers, it cannot be at the beginning, as per ES5.

(For example, the SockJS client library doesn't work under uglify starting with
d9ad3c7c.)

10 years agoadd `clean_getters` compressor option (default `false`)
Mihai Bazon [Wed, 2 Oct 2013 16:33:45 +0000 (19:33 +0300)]
add `clean_getters` compressor option (default `false`)

allows one to specify if `foo.bar` is considered to have side effects.

10 years agominor optimization
Mihai Bazon [Wed, 2 Oct 2013 12:31:31 +0000 (15:31 +0300)]
minor optimization

unlikely to help in hand-written code:

    (something() ? foo : bar) == foo  ==>  something()

10 years agoFix error in the output minifying `Function("return this")()`
Mihai Bazon [Mon, 30 Sep 2013 08:49:29 +0000 (11:49 +0300)]
Fix error in the output minifying `Function("return this")()`

11 years agoMore attempts to determine when addition is associative
Mihai Bazon [Sun, 22 Sep 2013 12:26:10 +0000 (15:26 +0300)]
More attempts to determine when addition is associative

Somebody hit me with bug reports on this. :)

Refs #300

11 years agoActually let's move away those monsters from the evaluate function
Mihai Bazon [Sun, 22 Sep 2013 11:54:32 +0000 (14:54 +0300)]
Actually let's move away those monsters from the evaluate function

ev() should do a single thing — evaluate constant expressions.  if that's
not possible, just return the original node.  it's not the best place for
partial evaluation there, instead doing it in the compress functions.