Mihai Bazon
642ba2e92c
rename the npm package to "uglify-js" and cli tool to "uglifyjs"
v2.2.0
2012-11-21 13:27:03 +02:00
Mihai Bazon
089ac908b7
fix #51
2012-11-18 17:37:45 +02:00
Mihai Bazon
0d3fd2ef30
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.
2012-11-17 12:05:31 +02:00
Richard van Velzen
e98119496a
Add support for somewhat preserving line numbers.
...
Usage: uglifyjs2 -b "beautify=0,preserve_line=1" /path/to/js
ref #46
2012-11-14 15:30:18 +02:00
Mihai Bazon
bdfcbf496b
better solution for the last test in constant switch folding
2012-11-14 12:21:43 +02:00
Mihai Bazon
dba8da4800
optimize constant switch blocks
...
ref. mishoo/UglifyJS#441
2012-11-14 12:06:07 +02:00
Mihai Bazon
60c0f40250
Merge branch 'optimize_concat' of https://github.com/rvanvelzen/UglifyJS2 into rvanvelzen-optimize_concat
2012-11-13 14:38:55 +02:00
Mihai Bazon
e02771a5f2
don't change order in binary expressions if both operands have side effects
2012-11-13 14:32:07 +02:00
Richard van Velzen
f96f796f71
Add simple optimization for empty-string concats.
...
ref. #43
2012-11-12 15:41:03 +01:00
Mihai Bazon
a9fa178f86
v2.1.11
v2.1.11
2012-11-12 13:24:52 +02:00
Mihai Bazon
53355bdb24
fix invalid AST produced by dropping unused variable
...
close #44
2012-11-12 13:23:57 +02:00
Mihai Bazon
f05c99d89f
Merge pull request #41 from Skalman/toString-patch
...
Convert x.toString() to ""+x instead of x+""
2012-11-12 00:47:56 -08:00
Dan Wolff
b49230ab8d
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();
}
2012-11-11 15:53:34 +02:00
Mihai Bazon
78856a3dab
declare dependency versions
...
close #40
2012-11-09 16:43:49 +02:00
Mihai Bazon
1e5e13ed81
AST_LabelRef no longer inherits from AST_SymbolRef
2012-11-08 15:39:14 +02:00
Mihai Bazon
64270b9778
v2.1.10
v2.1.10
2012-11-08 12:33:27 +02:00
Mihai Bazon
e312c5c2a7
fix API breakage
...
close #36 , #38
2012-11-08 12:31:28 +02:00
Mihai Bazon
1a5fd3e052
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.)
2012-11-08 11:43:14 +02:00
Mihai Bazon
5a7e54cf72
ignore node_modules/
2012-11-07 15:27:12 +02:00
Mihai Bazon
39f8a62703
v2.1.9
v2.1.9
2012-11-07 13:31:58 +02:00
Mihai Bazon
46be3f2bf1
fix another small regression
...
we do need parens here: `new (foo.bar().baz)`, but not here: `new foo.bar.baz`
2012-11-07 13:31:43 +02:00
Mihai Bazon
258b46f4dc
v2.1.8
v2.1.8
2012-11-07 13:03:11 +02:00
Mihai Bazon
80da21dab4
fix regression from 5346fb94 (shouldn't parenthesize i++ in x[i++])
2012-11-07 13:02:51 +02:00
Mihai Bazon
bb0e4d7126
v2.1.7
v2.1.7
2012-11-07 12:45:23 +02:00
Mihai Bazon
5276a4a873
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
2012-11-07 12:43:27 +02:00
Mihai Bazon
a1ae0c8609
parenthesize property access when it's the expression in New
...
refs #35
2012-11-07 12:26:33 +02:00
Mihai Bazon
a90c1aeafe
further fix for parens around New (refs #35 )
2012-11-07 11:49:06 +02:00
Mihai Bazon
ff388a8d2d
parenthesize a Call expression when its parent is New
...
fix #35
2012-11-07 11:36:15 +02:00
Mihai Bazon
5346fb94bb
add proper parens around unary expressions
...
fix #34
2012-11-07 11:23:50 +02:00
Mihai Bazon
a4f6d46118
add option to mangle names even if eval/with is in use
...
(for more fair comparison to Closure compiler)
2012-11-06 18:19:51 +02:00
Mihai Bazon
7f5f4d60b7
discard the hack that worked around the deprecation warning
...
(since the source-map module no longer uses require.js)
refs #9
2012-11-05 22:23:51 +02:00
Mihai Bazon
ffccb233e5
convert while into for
2012-11-05 16:01:20 +02:00
Mihai Bazon
fba0c1aafe
minor
2012-11-05 16:01:09 +02:00
Mihai Bazon
774f2ded94
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.
2012-11-05 13:13:06 +02:00
Mihai Bazon
85af942d64
print final semicolon
...
close #28
2012-11-05 13:09:39 +02:00
Mihai Bazon
8413787efc
use a Dictionary object instead of plain object for hashes
...
to mitigate the `__proto__` issue
related to #30
2012-11-02 10:58:45 +02:00
Mihai Bazon
dde57452aa
v2.1.6
2012-11-01 16:55:10 +02:00
Mihai Bazon
cf409800be
it's safe to negate expression in !EXP only in boolean context
...
#kendo
v2.1.6
2012-11-01 15:49:05 +02:00
Mihai Bazon
18270dd9f3
added unsafe_comps for negating <= with >
...
since it has the potential to break code, let's keep it disabled by default
2012-11-01 15:14:56 +02:00
Mihai Bazon
d4c25c571b
fix compressing UnaryPrefix
...
only try negating the expression if the operator is `!`
#kendo
2012-11-01 13:35:08 +02:00
Mihai Bazon
5248b79506
v2.1.5
v2.1.5
2012-10-30 14:51:05 +02:00
Mihai Bazon
abe0ebbf02
don't move expressions containing the binary in operator into the for initializer
...
(opera can't parse it)
close #25
2012-10-30 14:50:47 +02:00
Mihai Bazon
0852f5595e
v2.1.4
v2.1.4
2012-10-25 18:52:49 +03:00
Mihai Bazon
cb3cafa14d
cripple scope to make IE happy :-(
...
close #24
2012-10-25 18:52:35 +03:00
Mihai Bazon
202fb93799
test for fs.existsSync
2012-10-25 10:58:48 +03:00
Mihai Bazon
7b87d2ef83
v2.1.3
v2.1.3
2012-10-24 09:41:40 +03:00
Mihai Bazon
70fd2b1f33
fix for if (...) return; else return ...;
...
(it was assumed that the first `return` always contains a value)
close #22
2012-10-24 09:33:32 +03:00
Mihai Bazon
30faaf13ed
more sequence optimizations (lift some sequences above binary/unary expressions so that we can avoid parens)
2012-10-22 11:58:06 +03:00
Mihai Bazon
41be8632d3
v2.1.2
v2.1.2
2012-10-22 07:57:28 +03:00
Mihai Bazon
bee01dc1be
Merge branch 'master' of github.com:mishoo/UglifyJS2
2012-10-20 11:14:25 +03:00