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
Mihai Bazon
a84d07e312
add AST_Infinity node
2012-10-09 18:35:53 +03:00
Mihai Bazon
88beddfa91
make --comments keep @cc_on too
2012-10-09 18:25:00 +03:00
Mihai Bazon
1b0aab2ce9
added $propdoc to AST nodes and some cleanups
...
hopefully we can make the AST documentation self-generating
2012-10-09 18:20:39 +03:00
Mihai Bazon
9ead49641d
minor AST cleanup (AST_BlockStatement may inherit from AST_Block)
2012-10-09 13:59:17 +03:00
Mihai Bazon
e1862cd36f
add --ast-help
...
displays a rather cruel description of the AST classes, derived
directly from the node definitions.
2012-10-09 13:21:21 +03:00
Mihai Bazon
2c025f23db
fix detecting symbols in use
2012-10-09 13:13:55 +03:00
Mihai Bazon
9dfcd47ec8
Merge pull request #8 from SevInf/master
...
Fix crash in minify function
2012-10-09 03:04:33 -07:00
Sergej Tatarincev
203ecaf85b
Fix nodejs minify without inSourceMap exception
...
When inSourceMap is omitted fs.readFile throws exception. Fixed version
calls fs.readFile only when inSourceMap argument is present
2012-10-09 12:52:28 +03:00
Mihai Bazon
c967f0b0fe
fix inSourceMap in minify (should read the file)
2012-10-08 21:22:20 +03:00
Mihai Bazon
dfc04e6677
add simple API wrapper: UglifyJS.minify
...
(refs #7 )
2012-10-08 21:15:59 +03:00
Mihai Bazon
42ea3c95e0
added some basic API doc
2012-10-08 14:30:34 +03:00
Mihai Bazon
d4970b35ac
should not expose base54.sort() in the API docs, I think
2012-10-08 13:37:27 +03:00
Mihai Bazon
dd8286bce1
added --self to easily get a browser-runnable version of UglifyJS
2012-10-08 12:55:18 +03:00
Mihai Bazon
093a9031dc
eliminate redundant directives in the same scope
2012-10-08 12:53:17 +03:00
Mihai Bazon
80a18fe2fa
for certain nodes that we invent we might not have a original source file to
...
map from, so just use "?". and in any case, don't fail hard when addMapping throws.
2012-10-08 12:52:25 +03:00
Mihai Bazon
fe1411bba1
fix typo
2012-10-05 23:10:52 +03:00
Mihai Bazon
455ac5435d
remove unused code
2012-10-05 22:59:05 +03:00
Mihai Bazon
4a2b91220a
minor
2012-10-05 20:24:56 +03:00
Mihai Bazon
a1e0885930
replace (function(){ ...no side effects ... })() with undefined.
2012-10-05 16:51:16 +03:00
Mihai Bazon
7ae09120ed
prevent mangling only when eval is *called*, not when it's just referenced
2012-10-05 16:17:31 +03:00
Mihai Bazon
42c25d901c
add note about installation
2012-10-05 15:31:55 +03:00
Mihai Bazon
e88dcc3819
added --acorn and --spidermonkey options
v2.0
2012-10-05 15:22:12 +03:00
Mihai Bazon
ecd9f21467
fixed import of locations from SpiderMonkey AST
2012-10-05 15:05:06 +03:00
Mihai Bazon
a9b6f9909a
use the appropriate constructor for symbols
2012-10-04 17:28:35 +03:00
Mihai Bazon
708ec0467c
minor
2012-10-04 17:28:09 +03:00
Mihai Bazon
682a58a1f5
removed some unused variables
2012-10-04 08:49:18 +03:00
Mihai Bazon
f20c251882
moving code around
2012-10-03 21:39:47 +03:00
Mihai Bazon
2bd8a118c2
define AST_Node.from_mozilla_ast(ast)
...
returns an UglifyJS2 AST given a Mozilla AST. Still needs some work to do
(need to create specific nodes like AST_SymbolRef, AST_SymbolLambda
etc. instead of base AST_Symbol, in order for the mangler/compressor to work
properly)
2012-10-03 20:03:17 +03:00