Mihai Bazon [Fri, 4 Jan 2013 20:50:53 +0000 (22:50 +0200)]
v2.2.3
Mihai Bazon [Fri, 4 Jan 2013 12:17:33 +0000 (14:17 +0200)]
Fix handling of labels in nested scopes
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
Mihai Bazon [Thu, 3 Jan 2013 10:28:35 +0000 (02:28 -0800)]
Merge pull request #87 from BenoitZugmeyer/master
Add a --version option
Benoît Zugmeyer [Thu, 3 Jan 2013 10:22:37 +0000 (11:22 +0100)]
Set --version as a boolean #87
Benoît Zugmeyer [Thu, 3 Jan 2013 10:06:07 +0000 (11:06 +0100)]
--version option
Mihai Bazon [Wed, 2 Jan 2013 10:39:00 +0000 (12:39 +0200)]
Implement `-m sort=true`
close #83
Mihai Bazon [Fri, 21 Dec 2012 23:24:04 +0000 (01:24 +0200)]
Accept string or number as name of an accessor.
[not sure I'm happy about this fix]
Reference mishoo/UglifyJS#478
Mihai Bazon [Fri, 21 Dec 2012 19:04:15 +0000 (21:04 +0200)]
Optimize new Array(1, 2, 3) → [1, 2, 3]
Close #74
Mihai Bazon [Fri, 21 Dec 2012 09:57:08 +0000 (11:57 +0200)]
Fix output when semicolons is off.
(need to force a semicolon for the empty body of an `if`)
Close #72
Mihai Bazon [Wed, 12 Dec 2012 09:50:03 +0000 (11:50 +0200)]
Small cleanup
Mihai Bazon [Thu, 6 Dec 2012 12:25:18 +0000 (14:25 +0200)]
v2.2.2
Mihai Bazon [Thu, 6 Dec 2012 10:27:57 +0000 (12:27 +0200)]
Add proper parens in "NoIn" expressions.
fix #60.
Mihai Bazon [Wed, 5 Dec 2012 11:14:49 +0000 (13:14 +0200)]
small improvement on merging assignments into hoisted vars
Mihai Bazon [Wed, 5 Dec 2012 10:30:25 +0000 (12:30 +0200)]
When hoisting variables, try to merge in assignments that follow.
Mihai Bazon [Fri, 30 Nov 2012 09:33:50 +0000 (11:33 +0200)]
Revert "Fixed reading from STDIN."
It breaks usage like this:
echo '...code...' | uglifyjs
This reverts commit
e48802ad291fae5a16f2d23cbd25a0c433cdbe48.
Mihai Bazon [Fri, 30 Nov 2012 09:26:37 +0000 (11:26 +0200)]
Add test for issue #59
Mihai Bazon [Fri, 30 Nov 2012 09:16:09 +0000 (11:16 +0200)]
Don't messup compressor stack while optimizing Switch
Fix #59
Mihai Bazon [Thu, 29 Nov 2012 09:23:07 +0000 (01:23 -0800)]
Merge pull request #58 from roxeteer/master
Fixed reading from STDIN
Visa Kopu [Thu, 29 Nov 2012 08:51:15 +0000 (10:51 +0200)]
Fixed reading from STDIN.
Mihai Bazon [Sat, 24 Nov 2012 08:02:08 +0000 (10:02 +0200)]
fix #55
Mihai Bazon [Fri, 23 Nov 2012 08:25:44 +0000 (10:25 +0200)]
v2.2.1
Mihai Bazon [Fri, 23 Nov 2012 08:20:00 +0000 (10:20 +0200)]
fix for https://github.com/mishoo/UglifyJS/issues/474
Mihai Bazon [Wed, 21 Nov 2012 11:27:03 +0000 (13:27 +0200)]
rename the npm package to "uglify-js" and cli tool to "uglifyjs"
Mihai Bazon [Sun, 18 Nov 2012 15:37:45 +0000 (17:37 +0200)]
fix #51
Mihai Bazon [Sat, 17 Nov 2012 10:05:31 +0000 (12:05 +0200)]
retain (1,eval) as is when it's the expression of an AST_Call
otherwise we change the meaning of eval from global to lexical.
Richard van Velzen [Wed, 14 Nov 2012 13:04:47 +0000 (14:04 +0100)]
Add support for somewhat preserving line numbers.
Usage: uglifyjs2 -b "beautify=0,preserve_line=1" /path/to/js
ref #46
Mihai Bazon [Wed, 14 Nov 2012 10:21:43 +0000 (12:21 +0200)]
better solution for the last test in constant switch folding
Mihai Bazon [Wed, 14 Nov 2012 10:06:07 +0000 (12:06 +0200)]
optimize constant switch blocks
ref. mishoo/UglifyJS#441
Mihai Bazon [Tue, 13 Nov 2012 12:34:38 +0000 (14:34 +0200)]
Merge branch 'optimize_concat' of https://github.com/rvanvelzen/UglifyJS2 into rvanvelzen-optimize_concat
Mihai Bazon [Tue, 13 Nov 2012 12:32:07 +0000 (14:32 +0200)]
don't change order in binary expressions if both operands have side effects
Richard van Velzen [Mon, 12 Nov 2012 14:41:03 +0000 (15:41 +0100)]
Add simple optimization for empty-string concats.
ref. #43
Mihai Bazon [Mon, 12 Nov 2012 11:24:52 +0000 (13:24 +0200)]
v2.1.11
Mihai Bazon [Mon, 12 Nov 2012 11:23:57 +0000 (13:23 +0200)]
fix invalid AST produced by dropping unused variable
close #44
Mihai Bazon [Mon, 12 Nov 2012 08:47:56 +0000 (00:47 -0800)]
Merge pull request #41 from Skalman/toString-patch
Convert x.toString() to ""+x instead of x+""
Dan Wolff [Sun, 11 Nov 2012 13:53:34 +0000 (15:53 +0200)]
convert x.toString() to ""+x instead of x+""
In some places this can save one byte in whitespace, e.g. after return.
Example:
function f(arg) {
// return""+arg - no space between return and ""
return arg.toString();
}
Mihai Bazon [Fri, 9 Nov 2012 14:43:49 +0000 (16:43 +0200)]
declare dependency versions
close #40
Mihai Bazon [Thu, 8 Nov 2012 13:39:14 +0000 (15:39 +0200)]
AST_LabelRef no longer inherits from AST_SymbolRef
Mihai Bazon [Thu, 8 Nov 2012 10:33:27 +0000 (12:33 +0200)]
v2.1.10
Mihai Bazon [Thu, 8 Nov 2012 10:31:28 +0000 (12:31 +0200)]
fix API breakage
close #36, #38
Mihai Bazon [Wed, 7 Nov 2012 16:57:51 +0000 (18:57 +0200)]
optimization for if/break as first statement in a loop body
for(...; x; ...) if (y) break; → for(...; x&&!y; ...);
similarly for `while` and some combinations (i.e. the `break` appears in the
`else` clause, etc.)
Mihai Bazon [Wed, 7 Nov 2012 13:27:12 +0000 (15:27 +0200)]
ignore node_modules/
Mihai Bazon [Wed, 7 Nov 2012 11:31:58 +0000 (13:31 +0200)]
v2.1.9
Mihai Bazon [Wed, 7 Nov 2012 11:31:43 +0000 (13:31 +0200)]
fix another small regression
we do need parens here: `new (foo.bar().baz)`, but not here: `new foo.bar.baz`
Mihai Bazon [Wed, 7 Nov 2012 11:03:11 +0000 (13:03 +0200)]
v2.1.8
Mihai Bazon [Wed, 7 Nov 2012 11:02:51 +0000 (13:02 +0200)]
fix regression from
5346fb94 (shouldn't parenthesize i++ in x[i++])
Mihai Bazon [Wed, 7 Nov 2012 10:45:23 +0000 (12:45 +0200)]
v2.1.7
Mihai Bazon [Wed, 7 Nov 2012 10:43:27 +0000 (12:43 +0200)]
add AST_Accessor and AST_SymbolAccessor node types
AST_Accessor will represent the function for a setter or getter. Since they
are not mangleable, and they should not introduce a name in scope, we have a
new node for their name (AST_SymbolAccessor) which doesn't inherit from
AST_SymbolDeclaration.
fix #37
Mihai Bazon [Wed, 7 Nov 2012 10:26:33 +0000 (12:26 +0200)]
parenthesize property access when it's the expression in New
refs #35
Mihai Bazon [Wed, 7 Nov 2012 09:49:06 +0000 (11:49 +0200)]
further fix for parens around New (refs #35)
Mihai Bazon [Wed, 7 Nov 2012 09:36:15 +0000 (11:36 +0200)]
parenthesize a Call expression when its parent is New
fix #35
Mihai Bazon [Wed, 7 Nov 2012 09:23:17 +0000 (11:23 +0200)]
add proper parens around unary expressions
fix #34
Mihai Bazon [Tue, 6 Nov 2012 09:39:41 +0000 (11:39 +0200)]
add option to mangle names even if eval/with is in use
(for more fair comparison to Closure compiler)
Mihai Bazon [Mon, 5 Nov 2012 20:23:51 +0000 (22:23 +0200)]
discard the hack that worked around the deprecation warning
(since the source-map module no longer uses require.js)
refs #9
Mihai Bazon [Mon, 5 Nov 2012 14:01:20 +0000 (16:01 +0200)]
convert `while` into `for`
Mihai Bazon [Mon, 5 Nov 2012 14:01:09 +0000 (16:01 +0200)]
minor
Mihai Bazon [Mon, 5 Nov 2012 11:13:06 +0000 (13:13 +0200)]
minor optimization
for `==` or `!=` against a constant, prefer to display the constant first.
should help a bit after gzip, i.e.:
typeof foo=="undefined"
^^^^^^ ^^^^^^^^^^^^^
vs:
"undefined"==typeof foo
^^^^^^^^^^^^^^^^^^^ (longer sequence that could repeat)
idea stolen from closure.
Mihai Bazon [Mon, 5 Nov 2012 11:09:39 +0000 (13:09 +0200)]
print final semicolon
close #28
Mihai Bazon [Fri, 2 Nov 2012 08:58:45 +0000 (10:58 +0200)]
use a Dictionary object instead of plain object for hashes
to mitigate the `__proto__` issue
related to #30
Mihai Bazon [Thu, 1 Nov 2012 14:55:10 +0000 (16:55 +0200)]
v2.1.6
Mihai Bazon [Thu, 1 Nov 2012 13:49:05 +0000 (15:49 +0200)]
it's safe to negate expression in !EXP only in boolean context
#kendo
Mihai Bazon [Thu, 1 Nov 2012 13:14:56 +0000 (15:14 +0200)]
added unsafe_comps for negating `<=` with `>`
since it has the potential to break code, let's keep it disabled by default
Mihai Bazon [Thu, 1 Nov 2012 11:35:08 +0000 (13:35 +0200)]
fix compressing UnaryPrefix
only try negating the expression if the operator is `!`
#kendo
Mihai Bazon [Tue, 30 Oct 2012 12:51:05 +0000 (14:51 +0200)]
v2.1.5
Mihai Bazon [Tue, 30 Oct 2012 12:50:47 +0000 (14:50 +0200)]
don't move expressions containing the binary `in` operator into the `for` initializer
(opera can't parse it)
close #25
Mihai Bazon [Thu, 25 Oct 2012 15:52:49 +0000 (18:52 +0300)]
v2.1.4
Mihai Bazon [Thu, 25 Oct 2012 15:52:35 +0000 (18:52 +0300)]
cripple scope to make IE happy :-(
close #24
Mihai Bazon [Thu, 25 Oct 2012 07:58:48 +0000 (10:58 +0300)]
test for fs.existsSync
Mihai Bazon [Wed, 24 Oct 2012 06:41:40 +0000 (09:41 +0300)]
v2.1.3
Mihai Bazon [Wed, 24 Oct 2012 06:33:32 +0000 (09:33 +0300)]
fix for `if (...) return; else return ...;`
(it was assumed that the first `return` always contains a value)
close #22
Mihai Bazon [Mon, 22 Oct 2012 08:49:58 +0000 (11:49 +0300)]
more sequence optimizations (lift some sequences above binary/unary expressions so that we can avoid parens)
Mihai Bazon [Mon, 22 Oct 2012 04:57:28 +0000 (07:57 +0300)]
v2.1.2
Mihai Bazon [Sat, 20 Oct 2012 08:14:25 +0000 (11:14 +0300)]
Merge branch 'master' of github.com:mishoo/UglifyJS2
Mihai Bazon [Sat, 20 Oct 2012 08:12:21 +0000 (11:12 +0300)]
alternate hack to disable deprecation warning
ref #9, close #20
Mihai Bazon [Fri, 19 Oct 2012 11:29:40 +0000 (04:29 -0700)]
Merge pull request #19 from SevInf/master
Allow to specify sourceRoot in minify
Mihai Bazon [Fri, 19 Oct 2012 09:57:29 +0000 (12:57 +0300)]
minor fix for dropping unused definitions.
function f(x, y) {
var g = function() { return h() };
var h = function() { return g() };
return x + y;
}
now compresses to `function f(x, y) { return x + y }`
Sergej Tatarincev [Fri, 19 Oct 2012 09:35:19 +0000 (12:35 +0300)]
Add sourceRoot option to minify
Mihai Bazon [Thu, 18 Oct 2012 12:49:15 +0000 (15:49 +0300)]
add fromString argument to `UglifyJS.minify` (allows to pass the source
code, instead of file names, as first argument).
close #17
Mihai Bazon [Thu, 18 Oct 2012 12:14:57 +0000 (15:14 +0300)]
more optimizations for some break/continue cases
Mihai Bazon [Thu, 18 Oct 2012 07:54:30 +0000 (10:54 +0300)]
v2.1.1
Mihai Bazon [Thu, 18 Oct 2012 07:54:10 +0000 (10:54 +0300)]
fix `--comments` (close #16)
Mihai Bazon [Wed, 17 Oct 2012 19:00:11 +0000 (22:00 +0300)]
v2.1.0
Mihai Bazon [Wed, 17 Oct 2012 18:59:36 +0000 (21:59 +0300)]
added note about API docs and online demo
Mihai Bazon [Wed, 17 Oct 2012 18:57:08 +0000 (21:57 +0300)]
more small optimizations
(unlikely to help for hand-written code)
Mihai Bazon [Wed, 17 Oct 2012 13:17:14 +0000 (16:17 +0300)]
define aborts on AST_If: true if both branches abort
Mihai Bazon [Wed, 17 Oct 2012 12:56:45 +0000 (15:56 +0300)]
employ a better parser for command-line arguments
to support passing commas in strings in for example:
uglifyjs2 -cd TEST="'a,b'" <<EOF
console.log(TEST);
EOF
→ console.log("a,b")
close #14
Mihai Bazon [Wed, 17 Oct 2012 12:24:47 +0000 (15:24 +0300)]
the `sort` option is broken anyway, removed it
we need to mangle names from outermost to innermost scope; mangling names
from inner scopes before we got to the outer scope won't work correctly,
therefore sorting doesn't make sense.
Mihai Bazon [Wed, 17 Oct 2012 11:51:27 +0000 (14:51 +0300)]
add `semicolons` option in the code generator (default: `true`)
pass `false` to separate statements with newlines instead of semicolons
Mihai Bazon [Tue, 16 Oct 2012 12:54:12 +0000 (15:54 +0300)]
fix small glitches in source map generation
Mihai Bazon [Sat, 13 Oct 2012 12:18:11 +0000 (15:18 +0300)]
disable warnings in the test suite
Mihai Bazon [Sat, 13 Oct 2012 12:04:44 +0000 (15:04 +0300)]
drop unused function arguments
also add test for "drop_unused" (the last one fails for now)
Mihai Bazon [Sat, 13 Oct 2012 11:32:08 +0000 (14:32 +0300)]
add parens to AST_Seq whose parent is AST_Unary
Mihai Bazon [Sat, 13 Oct 2012 09:56:56 +0000 (12:56 +0300)]
fix compressing benchmark.js (it tried to evaluate a statement)
the following code in benchmark.js triggered the issue:
support.decompilation = Function(
'return (' + (function(x) { return { 'x': '' + (1 + x) + '', 'y': 0 }; }) + ')'
)()(0).x === '1';
technically that could be resolved into a constant expression, but seems
it's being used here for browser bugs detection :-\
Mihai Bazon [Sat, 13 Oct 2012 09:42:01 +0000 (12:42 +0300)]
minor
Mihai Bazon [Sat, 13 Oct 2012 09:24:27 +0000 (12:24 +0300)]
fix regression from
fb5c01c073d06034815d5f3b782fd11cbdf6d6f5
is_digit takes a char code now, not a string
Mihai Bazon [Sat, 13 Oct 2012 08:37:58 +0000 (11:37 +0300)]
fix end tokens in spidermonkey ast import
Mihai Bazon [Fri, 12 Oct 2012 21:35:24 +0000 (00:35 +0300)]
update for acorn
Mihai Bazon [Fri, 12 Oct 2012 11:55:54 +0000 (14:55 +0300)]
minor
Mihai Bazon [Fri, 12 Oct 2012 08:41:48 +0000 (11:41 +0300)]
actually enable the option that drops unused names in the test of issue #12
Mihai Bazon [Fri, 12 Oct 2012 08:07:35 +0000 (11:07 +0300)]
remove the $self hack
operations are destructive anyway, so there's no point to clone the nodes in
the transformer. speed++