Skip to content

Commit

Permalink
Merge pull request #1554 from alexlamsl/harmony-v2.8.6
Browse files Browse the repository at this point in the history
Merging from master for 2.8.7
  • Loading branch information
alexlamsl authored Mar 5, 2017
2 parents c8e6144 + aa60549 commit 3c2b3ae
Show file tree
Hide file tree
Showing 21 changed files with 1,187 additions and 142 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ The available options are:
--support-ie8 Use this flag to support Internet Explorer 6/7/8.
Equivalent to setting `screw_ie8: false` in `minify()`
for `compress`, `mangle` and `output` options.
Note: `--support-ie8` may generate incorrect code
for `try`/`catch` in ES5 compliant browsers.
--expr Parse a single expression, rather than a
program (for parsing JSON)
-p, --prefix Skip prefix for original filenames that appear
Expand Down Expand Up @@ -350,6 +348,9 @@ to set `true`; it's effectively a shortcut for `foo=true`).
comparison are switching. Compression only works if both `comparisons` and
`unsafe_comps` are both set to true.

- `unsafe_math` (default: false) -- optimize numerical expressions like
`2 * x * 3` into `6 * x`, which may give imprecise floating point results.

- `unsafe_proto` (default: false) -- optimize expressions like
`Array.prototype.slice.call(a)` into `[].slice.call(a)`

Expand Down Expand Up @@ -423,6 +424,9 @@ to set `true`; it's effectively a shortcut for `foo=true`).
such as `console.info` and/or retain side effects from function arguments
after dropping the function call then use `pure_funcs` instead.

- `expression` -- default `false`. Pass `true` to preserve completion values
from terminal statements without `return`, e.g. in bookmarklets.

- `keep_fargs` -- default `true`. Prevents the
compressor from discarding unused function arguments. You need this
for code which relies on `Function.length`.
Expand Down
14 changes: 9 additions & 5 deletions bin/uglifyjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var sys = require("util");
var yargs = require("yargs");
var fs = require("fs");
var path = require("path");
var async = require("async");
var acorn;
var screw_ie8 = true;
var ARGS = yargs
Expand All @@ -27,7 +26,7 @@ mangling you need to use `-c` and `-m`.\
.describe("source-map-include-sources", "Pass this flag if you want to include the content of source files in the source map as sourcesContent property.")
.describe("in-source-map", "Input source map, useful if you're compressing JS that was generated from some other original code.")
.describe("screw-ie8", "Do not support Internet Explorer 6/7/8. This flag is enabled by default.")
.describe("support-ie8", "Support non-standard Internet Explorer 6/7/8 javascript. Note: may generate incorrect code for try/catch in ES5 compliant browsers.")
.describe("support-ie8", "Support non-standard Internet Explorer 6/7/8 javascript.")
.describe("expr", "Parse a single expression, rather than a program (for parsing JSON)")
.describe("p", "Skip prefix for original filenames that appear in source maps. \
For example -p 3 will drop 3 directories from file names and ensure they are relative paths. \
Expand Down Expand Up @@ -319,8 +318,11 @@ var STATS = {};
var TOPLEVEL = null;
var P_RELATIVE = ARGS.p && ARGS.p == "relative";
var SOURCES_CONTENT = {};
var index = 0;

async.eachLimit(files, 1, function (file, cb) {
!function cb() {
if (index == files.length) return done();
var file = files[index++];
read_whole_file(file, function (err, code) {
if (err) {
print_error("ERROR: can't read file: " + file);
Expand Down Expand Up @@ -388,7 +390,9 @@ async.eachLimit(files, 1, function (file, cb) {
});
cb();
});
}, function () {
}();

function done() {
var OUTPUT_FILE = ARGS.o;

var SOURCE_MAP = (ARGS.source_map || ARGS.source_map_inline) ? UglifyJS.SourceMap({
Expand Down Expand Up @@ -537,7 +541,7 @@ async.eachLimit(files, 1, function (file, cb) {
}));
}
}
});
}

/* -----[ functions ]----- */

Expand Down
3 changes: 0 additions & 3 deletions lib/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,6 @@ var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, {

var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
$documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
$propdoc: {
init: "[AST_Node*/S] array of initializers for this declaration."
},
}, AST_Symbol);

var AST_SymbolVar = DEFNODE("SymbolVar", null, {
Expand Down
Loading

0 comments on commit 3c2b3ae

Please sign in to comment.