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
Mihai Bazon
12f71e01d0
alternate hack to disable deprecation warning
...
ref #9 , close #20
2012-10-20 11:12:21 +03:00
Mihai Bazon
3a72deacab
Merge pull request #19 from SevInf/master
...
Allow to specify sourceRoot in minify
2012-10-19 04:29:40 -07:00
Mihai Bazon
fc8314e810
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 }`
2012-10-19 12:57:29 +03:00
Sergej Tatarincev
11dffe950e
Add sourceRoot option to minify
2012-10-19 12:35:19 +03:00
Mihai Bazon
6f45928a73
add fromString argument to UglifyJS.minify (allows to pass the source
...
code, instead of file names, as first argument).
close #17
2012-10-18 15:49:15 +03:00
Mihai Bazon
afb7faa6fa
more optimizations for some break/continue cases
2012-10-18 15:14:57 +03:00
Mihai Bazon
6aa56f92fe
v2.1.1
v2.1.1
2012-10-18 10:54:30 +03:00
Mihai Bazon
4fe4257c69
fix --comments ( close #16 )
2012-10-18 10:54:10 +03:00
Mihai Bazon
a5e75c5a21
v2.1.0
2012-10-17 22:00:11 +03:00
Mihai Bazon
4482fdd63f
added note about API docs and online demo
v2.1
2012-10-17 21:59:36 +03:00
Mihai Bazon
253bd8559b
more small optimizations
...
(unlikely to help for hand-written code)
2012-10-17 21:57:08 +03:00
Mihai Bazon
6a099fba66
define aborts on AST_If: true if both branches abort
2012-10-17 16:17:14 +03:00
Mihai Bazon
a21f3c6cdd
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
2012-10-17 15:56:45 +03:00
Mihai Bazon
8f66458598
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.
2012-10-17 15:24:47 +03:00
Mihai Bazon
6472f9410e
add semicolons option in the code generator (default: true)
...
pass `false` to separate statements with newlines instead of semicolons
2012-10-17 14:52:08 +03:00
Mihai Bazon
8957b3a694
fix small glitches in source map generation
2012-10-16 15:54:12 +03:00
Mihai Bazon
1ffd526554
disable warnings in the test suite
2012-10-13 15:18:11 +03:00
Mihai Bazon
fcc0229087
drop unused function arguments
...
also add test for "drop_unused" (the last one fails for now)
2012-10-13 15:04:44 +03:00
Mihai Bazon
b071c9d079
add parens to AST_Seq whose parent is AST_Unary
2012-10-13 14:32:08 +03:00
Mihai Bazon
851b48e4a3
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 :-\
2012-10-13 12:57:10 +03:00
Mihai Bazon
708abb1ab1
minor
2012-10-13 12:42:01 +03:00
Mihai Bazon
370d3e0917
fix regression from fb5c01c073
...
is_digit takes a char code now, not a string
2012-10-13 12:24:27 +03:00
Mihai Bazon
b51fe0dcc3
fix end tokens in spidermonkey ast import
2012-10-13 11:37:58 +03:00
Mihai Bazon
70d205c447
update for acorn
2012-10-13 00:35:24 +03:00
Mihai Bazon
8149be551e
minor
2012-10-12 14:55:54 +03:00
Mihai Bazon
ba3df646c0
actually enable the option that drops unused names in the test of issue #12
2012-10-12 11:41:48 +03:00
Mihai Bazon
1b6f8d463f
remove the $self hack
...
operations are destructive anyway, so there's no point to clone the nodes in
the transformer. speed++
2012-10-12 11:07:35 +03:00
Mihai Bazon
731fa9c236
add test for issue #12
2012-10-12 10:49:48 +03:00
Mihai Bazon
72cb5328ee
fix in_boolean_context() (two tests were broken)
2012-10-12 10:49:41 +03:00
Mihai Bazon
fc39553714
use AST_Lambda for object setters/getters
...
so that the optimization that drops the name if unused doesn't apply.
close #12
2012-10-12 10:11:01 +03:00
Mihai Bazon
d9d67317b1
fix pos in syntax error exception
2012-10-11 15:25:38 +03:00
Mihai Bazon
fb5c01c073
stealing more hacks from acorn in the name of speed
2012-10-11 15:17:42 +03:00
Mihai Bazon
f4584af42c
using makeComparator from acorn to generate functions that tests whether a
...
string is keyword, reserved etc.
speeds up the parser a bit, though not spectacular.. still far from acorn.
2012-10-11 11:52:05 +03:00
Mihai Bazon
172aa7a93c
cleanup
...
- use prototype-less objects where feasible (minor speed improvement)
- get rid of HOP
2012-10-11 11:07:42 +03:00
Mihai Bazon
5053a29bc0
fix propagation of symbol references
2012-10-11 10:28:48 +03:00
Mihai Bazon
f322b32e0e
disable warnings by default in minify (pass warnings: true to enable)
...
close #11
2012-10-11 09:31:17 +03:00
Mihai Bazon
9cdaed9860
fix node name
2012-10-10 23:16:40 +03:00
Mihai Bazon
dacce1b1fa
seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration
2012-10-10 11:37:51 +03:00
Mihai Bazon
f26f3b44bc
small improvements in wrap_commonjs:
...
- use MAP.splice instead of a BlockStatement to inject code (avoids some
warnings in the linter)
- use the original symbol in exports, so that we get the proper source mapping
2012-10-10 11:28:05 +03:00
Mihai Bazon
c5ecbfc756
drop unused variable
2012-10-10 11:27:06 +03:00
Mihai Bazon
3799ac8973
add --lint and display {file} in scope_warnings
2012-10-10 11:26:59 +03:00
Mihai Bazon
86182afa7f
minor
2012-10-09 22:56:59 +03:00
Mihai Bazon
4807c6e756
update on @cc_on
2012-10-09 19:09:11 +03:00