aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-02-27add harmony branch details in README (#1507)kzc
2017-02-26faster tree transversal (#1462)Alex Lam S.L
- convert `[].forEach()` to for-loops
2017-02-26consolidate `evaluate` & `reduce_vars` (#1505)Alex Lam S.L
- improve marking efficiency - apply smarter `const` replacement to `var` fixes #1501
2017-02-25update docs for `pure_funcs` & `drop_console` (#1503)Alex Lam S.L
closes #1362 closes #1399
2017-02-25allow --in-source-map inline (#1490)Alex Lam S.L
- limited to one input file (or `stdin`) - only works with built-in parser fixes #520
2017-02-24Avoid using exports when undefined (#1471)Ondřej Španěl
Makes direct usage within web browser easier, even if officially unsupported.
2017-02-24Merge pull request #1485 from alexlamsl/merge-2.8.0Alex Lam S.L
2.8.0 staging
2017-02-24enable `collapse_vars` & `reduce_vars` by defaultalexlamsl
- fix corner cases in `const` optimisation - deprecate `/*@const*/` fixes #1497 closes #1498
2017-02-21Support marking a call as purekzc
A function call or IIFE with an immediately preceding comment containing `@__PURE__` or `#__PURE__` is deemed to be a side-effect-free pure function call and can potentially be dropped. Depends on `side_effects` option. `[#@]__PURE__` hint will be removed from comment when pure call is dropped. fixes #1261 closes #1448
2017-02-21Fix: AST_Accessor missing start / end tokensOndřej Španěl
fixes #1492 closes #1493
2017-02-21fix `pure_funcs` & improve `side_effects`alexlamsl
- only drops side-effect-free arguments - drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement` closes #1494
2017-02-21clean up `max_line_len`alexlamsl
- never exceed specified limit - otherwise warning is shown - enabled only for final output closes #1496
2017-02-21introduce `unsafe_proto`alexlamsl
- `Array.prototype.slice` => `[].slice` closes #1491
2017-02-21remove extraneous spaces between ++/+/--/-alexlamsl
fixes #1377 closes #1488
2017-02-21Add .gitattributes to checkout lf eol styleAnthony Van de Gejuchte
closes #1487
2017-02-21improve `--beautify bracketize`alexlamsl
reduce whitespaces from if-else statements fixes #1482 closes #1483
2017-02-21add benchmark & JetStream testsalexlamsl
- `test/benchmark.js` measures performance - `test/jetstream.js` verifies correctness - configurable mangle/compress/output options closes #1479
2017-02-21enhance `global_defs`alexlamsl
- support arrays, objects & AST_Node - support `"a.b":1` on both cli & API - emit warning if variable is modified - override top-level variables fixes #1416 closes #1198 closes #1469
2017-02-21evaluate AST_SymbolRef as parameteralexlamsl
fix invalid boolean conversion now exposed in `make_node_from_constant()` closes #1477
2017-02-21improve reduce_vars and fix a bugalexlamsl
- update modified flag between compress() passes - support IIFE arguments - fix corner case with multiple definitions closes #1473
2017-02-21improve keep_fargs & keep_fnamesalexlamsl
- utilise in_use_ids instead of unreferenced() - drop_unused now up-to-date for subsequent passes closes #1476
2017-02-21fix duplicated test namesalexlamsl
previously test cases with the same name would be skipped except for the last one `test/run-test.js` will now report duplicated names as errors closes #1461
2017-02-21smarter const replacement taking name length into accountkzc
closes #1459
2017-02-21clean up `negate_iife`alexlamsl
- remove extra tree scanning phase for `negate_iife` - `negate_iife` now only deals with the narrowest form, i.e. IIFE sitting directly under `AST_SimpleStatement` - `booleans`, `conditionals` etc. will now take care the rest via more accurate accounting - `a(); void b();` => `a(); b();` fixes #1288 closes #1451
2017-02-21improve string concatenationalexlamsl
shuffle associative operations to minimise parentheses and aid other uglification efforts closes #1454
2017-02-21`-c sequences=N` suboptimal at N expression cutoffalexlamsl
N = 2: a; b; c; d; was: a, b; c; d; now: a, b; c, d; fixes #1455 closes #1457
2017-02-21tweak do-while loopsalexlamsl
- `do{...}while(false)` => `{...}` - clean up `AST_While` logic closes #1452
2017-02-21fixes & improvements to [].join()alexlamsl
fixes - [a].join() => "" + a - ["a", , "b"].join() => "a,,b" - ["a", null, "b"].join() => "a,,b" - ["a", undefined, "b"].join() => "a,,b" improvements - ["a", "b"].join(null) => "anullb" - ["a", "b"].join(undefined) => "a,b" - [a + "b", c].join("") => a + "b" + c closes #1453
2017-02-21drop unused: toplevel, assign-onlyalexlamsl
- assign statement does not count towards variable usage by default - only works with assignments on the same scope level as declaration - can be disabled with `unused` set to "keep_assign" - `toplevel` to drop unused top-level variables and/or functions - `top_retain` to whitelist top-level exceptions closes #1450
2017-02-21fix stray else in compress with conditionals=falsekzc
closes #1449
2017-02-18enable typeof "undefined" for general usealexlamsl
move out of unsafe, guard corner case with screw_id8 instead closes #1446
2017-02-18fix corner case in keep_fnamesalexlamsl
happens when inner function: - just below top level - not referenced - `unused` is disabled closes #1445
2017-02-18remove unused AST_Scope.nesting & AST_SymbolRef.framealexlamsl
they are computed but never used closes #1444
2017-02-18fix crash in unsafe replacement of undefinedalexlamsl
remove extraneous call to AST_SymbolRef.reference() closes #1443
2017-02-18Improve optimizing `function() { if(c){return foo} bar();}`Anthony Van de Gejuchte
closes #1437
2017-02-12Merge pull request #1481 from anatdagan/propsmangle_only_identifiersMihai Bazon
verify that property names after mangle are legal
2017-02-10in mangle_names there is a check that the variable name is legal and that it ↵Anat Dagan
is not a reserved word. This should apply to propsmangle as well.
2017-01-26update test (#1441)Alex Lam S.L
improved reduce_vars & binary operands produce more optimal results
2017-01-26fix mangling collision with keep_fnames (#1431)Alex Lam S.L
* fix mangling collision with keep_fnames fixes #1423 * pass mangle options to figure_out_scope() bring command-line in line with minify()
2017-01-26optimise binary operands with evaluate() (#1427)Alex Lam S.L
- remove call to evaluate() in is_constant() and let nested optimize() does its job instead - reject RegExp in is_constant() and remove special case logic under collapse_vars - operands to conditionals optimisation are now always evaluate()-ed - throw error in constant_value() instead of returning undefined to catch possible bugs, similar to make_node_from_constant() - optimise binary boolean operators under `evaluate` instead of `conditionals`
2017-01-26augment evaluate to extract within objects (#1425)Alex Lam S.L
- gated by `unsafe` - replaces previous optimisation specific to String.length - "123"[0] => 1 - [1, 2, 3][0] => 1 - [1, 2, 3].length => 3 - does not apply to objects with overridden prototype functions
2017-01-19add missing LHS cases which global_defs should avoidalexlamsl
2017-01-19Have minify() and tests use figure_out_scope() as uglifyjs CLI doeskzc
Clarify docs, help and tests for --support-ie8 and screw_ie8=false
2017-01-19Add preventive test involving non-ascii function identifiersAnthony Van de Gejuchte
2017-01-19Add note about name mangling when using --mangle-props=unquoted (#1314)Wiktor Kwapisiewicz
2016-11-30remove npm-shrinkwrap.json to work around npm@4.0.2 bug (#1384)kzc
2016-11-29v2.7.5Richard van Velzen
2016-11-29Generate source map data from normalized filesMartijn Swaagman
If using `inSourceMap` this fix will ensure the copying of `sourcesContent` is based on potentially normalized `sources` values (https://github.com/mozilla/source-map/blob/master/lib/source-map-consumer.js#L304-L309). For example `normalize` (https://github.com/mozilla/source-map/blob/master/lib/util.js#L80-L123) will rewrite `./dist/mySource.js` to `dist/mySource.js` in the target `_sources` of the `SourceMapConsumer`. As a result `orig_map.sourceContentFor(source, true);` would return `null` since the orginal `source` was no longer available in the consumer. By using the keys generating from the `SourceMapConsumer.constructor` consistency is ensured.
2016-11-29docs: add doc for option.outFileName1111hui
2016-11-29feat: add option.outFileName for JS API, if absense, sourceMap.file field ↵1111hui
will deduced