updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

2
node_modules/uglify-js/README.md generated vendored
View File

@@ -664,7 +664,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
- `keep_fnames` (default: `false`) -- Pass `true` to prevent the
compressor from discarding function names. Useful for code relying on
`Function.prototype.name`. See also: the `keep_fnames` [mangle option](#mangle).
`Function.prototype.name`. See also: the `keep_fnames` [mangle option](#mangle-options).
- `keep_infinity` (default: `false`) -- Pass `true` to prevent `Infinity` from
being compressed into `1/0`, which may cause performance issues on Chrome.

19
node_modules/uglify-js/bin/uglifyjs generated vendored
View File

@@ -56,6 +56,11 @@ program.option("--wrap <name>", "Embed everything as a function with “exports
program.arguments("[files...]").parseArgv(process.argv);
if (program.configFile) {
options = JSON.parse(read_file(program.configFile));
if (options.mangle && options.mangle.properties && options.mangle.properties.regex) {
options.mangle.properties.regex = UglifyJS.parse(options.mangle.properties.regex, {
expression: true
}).getValue();
}
}
if (!program.output && program.sourceMap && program.sourceMap.url != "inline") {
fatal("ERROR: cannot write source map to STDOUT");
@@ -337,17 +342,9 @@ function parse_js(flag) {
return function(value, options) {
options = options || {};
try {
UglifyJS.minify(value, {
parse: {
expression: true
},
compress: false,
mangle: false,
output: {
ast: true,
code: false
}
}).ast.walk(new UglifyJS.TreeWalker(function(node) {
UglifyJS.parse(value, {
expression: true
}).walk(new UglifyJS.TreeWalker(function(node) {
if (node instanceof UglifyJS.AST_Assign) {
var name = node.left.print_to_string();
var value = node.right;

View File

@@ -106,10 +106,16 @@ function Compressor(options, false_by_default) {
var pure_funcs = this.options["pure_funcs"];
if (typeof pure_funcs == "function") {
this.pure_funcs = pure_funcs;
} else {
this.pure_funcs = pure_funcs ? function(node) {
} else if (typeof pure_funcs == "string") {
this.pure_funcs = function(node) {
return pure_funcs !== node.expression.print_to_string();
};
} else if (Array.isArray(pure_funcs)) {
this.pure_funcs = function(node) {
return pure_funcs.indexOf(node.expression.print_to_string()) < 0;
} : return_true;
};
} else {
this.pure_funcs = return_true;
}
var top_retain = this.options["top_retain"];
if (top_retain instanceof RegExp) {
@@ -497,6 +503,15 @@ merge(Compressor.prototype, {
d.direct_access = true;
}
function mark_assignment_to_arguments(node) {
if (!(node instanceof AST_Sub)) return;
var expr = node.expression;
var prop = node.property;
if (expr instanceof AST_SymbolRef && expr.name == "arguments" && prop instanceof AST_Number) {
expr.definition().reassigned = true;
}
}
var suppressor = new TreeWalker(function(node) {
if (!(node instanceof AST_Symbol)) return;
var d = node.definition();
@@ -515,7 +530,10 @@ merge(Compressor.prototype, {
def(AST_Assign, function(tw, descend, compressor) {
var node = this;
var sym = node.left;
if (!(sym instanceof AST_SymbolRef)) return;
if (!(sym instanceof AST_SymbolRef)) {
mark_assignment_to_arguments(sym);
return;
}
var d = sym.definition();
var safe = safe_to_assign(tw, d, sym.scope, node.right);
d.assignments++;
@@ -758,7 +776,10 @@ merge(Compressor.prototype, {
var node = this;
if (node.operator != "++" && node.operator != "--") return;
var exp = node.expression;
if (!(exp instanceof AST_SymbolRef)) return;
if (!(exp instanceof AST_SymbolRef)) {
mark_assignment_to_arguments(exp);
return;
}
var d = exp.definition();
var safe = safe_to_assign(tw, d, exp.scope, true);
d.assignments++;
@@ -1570,13 +1591,19 @@ merge(Compressor.prototype, {
var found = false;
return statements[stat_index].transform(new TreeTransformer(function(node, descend, in_list) {
if (found) return node;
if (node === expr || node.body === expr) {
if (node !== expr && node.body !== expr) return;
if (node instanceof AST_VarDef) {
found = true;
if (node instanceof AST_VarDef) {
node.value = null;
return node;
}
return in_list ? MAP.skip : null;
node.value = null;
return node;
}
if (in_list) {
found = true;
return MAP.skip;
}
if (!this.parent()) {
found = true;
return null;
}
}, function(node) {
if (node instanceof AST_Sequence) switch (node.expressions.length) {
@@ -1616,7 +1643,7 @@ merge(Compressor.prototype, {
function symbol_in_lvalues(sym, parent) {
var lvalue = lvalues[sym.name];
if (!lvalue) return;
if (lvalue !== lhs) return !(parent instanceof AST_Call);
if (lvalue !== lhs) return !(parent instanceof AST_Call && parent.expression === sym);
scan_rhs = false;
}
@@ -2700,19 +2727,25 @@ merge(Compressor.prototype, {
return typeof function(){};
}
if (!non_converting_unary[this.operator]) depth++;
e = e._eval(compressor, cached, depth);
if (e === this.expression) return this;
var v = e._eval(compressor, cached, depth);
if (v === this.expression) return this;
switch (this.operator) {
case "!": return !e;
case "!": return !v;
case "typeof":
// typeof <RegExp> returns "object" or "function" on different platforms
// so cannot evaluate reliably
if (e instanceof RegExp) return this;
return typeof e;
case "void": return void e;
case "~": return ~e;
case "-": return -e;
case "+": return +e;
if (v instanceof RegExp) return this;
return typeof v;
case "void": return void v;
case "~": return ~v;
case "-": return -v;
case "+": return +v;
case "++":
case "--":
if (e instanceof AST_SymbolRef) {
var refs = e.definition().references;
if (refs[refs.length - 1] === e) return v;
}
}
return this;
});
@@ -5772,8 +5805,8 @@ merge(Compressor.prototype, {
}
if (single_use && fixed) {
def.single_use = false;
fixed._squeezed = true;
if (fixed instanceof AST_Defun) {
fixed._squeezed = true;
fixed = make_node(AST_Function, fixed, fixed);
fixed.name = make_node(AST_SymbolLambda, fixed.name, fixed.name);
}
@@ -5797,6 +5830,14 @@ merge(Compressor.prototype, {
lambda_def.references.push(node);
} else {
def.single_use = false;
var fn = node.fixed_value();
if (!(fn instanceof AST_Lambda)) return;
if (!fn.name) return;
if (fixed.variables.get(fn.name.name) !== fn.name.definition()) return;
fn.name = fn.name.clone();
var value_def = value.variables.get(fn.name.name) || value.def_function(fn.name);
node.thedef = value_def;
value_def.references.push(node);
}
}));
} else {
@@ -6051,12 +6092,14 @@ merge(Compressor.prototype, {
if (seq_tail instanceof AST_Assign) {
var is_eq = seq_tail.operator == "=";
var alt_tail = is_eq ? alternative.tail_node() : alternative;
if ((is_eq || consequent instanceof AST_Assign)
if ((is_eq || consequent === seq_tail)
&& alt_tail instanceof AST_Assign
&& seq_tail.operator == alt_tail.operator
&& seq_tail.left.equivalent_to(alt_tail.left)
&& (!condition.has_side_effects(compressor)
|| is_eq && !seq_tail.left.has_side_effects(compressor))) {
&& (is_eq && !seq_tail.left.has_side_effects(compressor)
|| !condition.has_side_effects(compressor)
&& can_shift_lhs_of_tail(consequent)
&& can_shift_lhs_of_tail(alternative))) {
return make_node(AST_Assign, self, {
operator: seq_tail.operator,
left: seq_tail.left,
@@ -6221,6 +6264,19 @@ merge(Compressor.prototype, {
}
}
function can_shift_lhs_of_tail(node) {
if (node === node.tail_node()) return true;
var exprs = node.expressions;
for (var i = exprs.length - 1; --i >= 0;) {
var expr = exprs[i];
if (!(expr instanceof AST_Assign) && expr.has_side_effects(compressor)
|| expr.operator != "="
|| expr.left.has_side_effects(compressor)
|| expr.right.has_side_effects(compressor)) return false;
}
return true;
}
function pop_lhs(node) {
if (!(node instanceof AST_Sequence)) return node.right;
var exprs = node.expressions.slice();
@@ -6304,13 +6360,16 @@ merge(Compressor.prototype, {
&& expr instanceof AST_SymbolRef
&& expr.name == "arguments"
&& expr.definition().orig.length == 1
&& (fn = expr.scope) instanceof AST_Lambda
&& prop instanceof AST_Number) {
&& prop instanceof AST_Number
&& (fn = expr.scope) === compressor.find_parent(AST_Lambda)) {
var index = prop.getValue();
var argname = fn.argnames[index];
if (argname && compressor.has_directive("use strict")) {
var def = argname.definition();
if (!compressor.option("reduce_vars") || def.assignments || def.orig.length > 1) {
if (!compressor.option("reduce_vars")
|| expr.definition().reassigned
|| def.assignments
|| def.orig.length > 1) {
argname = null;
}
} else if (!argname && !compressor.option("keep_fargs") && index < fn.argnames.length + 5) {
@@ -6423,7 +6482,7 @@ merge(Compressor.prototype, {
OPT(AST_Dot, function(self, compressor) {
if (self.property == "arguments" || self.property == "caller") {
compressor.warn("Function.protoype.{prop} not supported [{file}:{line},{col}]", {
compressor.warn("Function.prototype.{prop} not supported [{file}:{line},{col}]", {
prop: self.property,
file: self.start.file,
line: self.start.line,

29
node_modules/uglify-js/lib/parse.js generated vendored
View File

@@ -758,17 +758,21 @@ function parse($TEXT, options) {
croak(msg, token.line, token.col);
}
function token_to_string(type, value) {
return type + (value === undefined ? "" : " «" + value + "»");
}
function unexpected(token) {
if (token == null)
token = S.token;
token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
token_error(token, "Unexpected token: " + token_to_string(token.type, token.value));
}
function expect_token(type, val) {
if (is(type, val)) {
return next();
}
token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");
token_error(S.token, "Unexpected token: " + token_to_string(S.token.type, S.token.value) + ", expected: " + token_to_string(type, val));
}
function expect(punc) {
@@ -788,7 +792,7 @@ function parse($TEXT, options) {
function semicolon(optional) {
if (is("punc", ";")) next();
else if (!optional && !can_insert_semicolon()) unexpected();
else if (!optional && !can_insert_semicolon()) expect_token("punc", ";");
}
function parenthesised() {
@@ -1069,7 +1073,7 @@ function parse($TEXT, options) {
var in_statement = ctor === AST_Defun;
var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;
if (in_statement && !name)
unexpected();
expect_token("name");
if (name && ctor !== AST_Accessor && !(name instanceof AST_SymbolDeclaration))
unexpected(prev());
expect("(");
@@ -1119,7 +1123,7 @@ function parse($TEXT, options) {
expect("{");
var a = [];
while (!is("punc", "}")) {
if (is("eof")) unexpected();
if (is("eof")) expect_token("punc", "}");
a.push(statement(strict_defun));
}
next();
@@ -1130,7 +1134,7 @@ function parse($TEXT, options) {
expect("{");
var a = [], cur = null, branch = null, tmp;
while (!is("punc", "}")) {
if (is("eof")) unexpected();
if (is("eof")) expect_token("punc", "}");
if (is("keyword", "case")) {
if (branch) branch.end = prev();
cur = [];
@@ -1141,8 +1145,7 @@ function parse($TEXT, options) {
});
a.push(branch);
expect(":");
}
else if (is("keyword", "default")) {
} else if (is("keyword", "default")) {
if (branch) branch.end = prev();
cur = [];
branch = new AST_Default({
@@ -1150,8 +1153,7 @@ function parse($TEXT, options) {
body : cur
});
a.push(branch);
}
else {
} else {
if (!cur) unexpected();
cur.push(statement());
}
@@ -1420,10 +1422,10 @@ function parse($TEXT, options) {
}
function as_name() {
var tmp = S.token;
if (tmp.type != "name") unexpected();
if (!is("name")) expect_token("name");
var name = S.token.value;
next();
return tmp.value;
return name;
}
function _make_symbol(type) {
@@ -1625,6 +1627,7 @@ function parse($TEXT, options) {
}
if (options.expression) {
handle_regexp();
return expression(true);
}

View File

@@ -309,8 +309,12 @@ function names_in_use(scope, options) {
if (!names) {
scope.names_in_use = names = Object.create(scope.mangled_names || null);
scope.cname_holes = [];
var cache = options.cache && options.cache.props;
scope.enclosed.forEach(function(def) {
if (def.unmangleable(options)) names[def.name] = true;
if (def.global && cache && cache.has(def.name)) {
names[cache.get(def.name)] = true;
}
});
}
return names;

16
node_modules/uglify-js/package.json generated vendored
View File

@@ -1,8 +1,8 @@
{
"_from": "uglify-js@3.4.x",
"_id": "uglify-js@3.4.9",
"_id": "uglify-js@3.4.10",
"_inBundle": false,
"_integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
"_integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==",
"_location": "/uglify-js",
"_phantomChildren": {},
"_requested": {
@@ -18,8 +18,8 @@
"_requiredBy": [
"/html-minifier"
],
"_resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
"_shasum": "af02f180c1207d76432e473ed24a28f4a782bae3",
"_resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
"_shasum": "9ad9563d8eb3acdfb8d38597d2af1d815f6a755f",
"_spec": "uglify-js@3.4.x",
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\html-minifier",
"author": {
@@ -35,14 +35,14 @@
},
"bundleDependencies": false,
"dependencies": {
"commander": "~2.17.1",
"commander": "~2.19.0",
"source-map": "~0.6.1"
},
"deprecated": false,
"description": "JavaScript parser, mangler/compressor and beautifier toolkit",
"devDependencies": {
"acorn": "~5.7.1",
"semver": "~5.5.0"
"acorn": "~6.1.1",
"semver": "~5.6.0"
},
"engines": {
"node": ">=0.8.0"
@@ -99,5 +99,5 @@
"scripts": {
"test": "node test/run-tests.js"
},
"version": "3.4.9"
"version": "3.4.10"
}