Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c14d09ba84 | ||
|
|
4fc39d8dad | ||
|
|
0b7c70f726 |
@@ -118,7 +118,8 @@ a double dash to prevent input files being used as option arguments:
|
||||
JS that was generated from some other original
|
||||
code. Specify "inline" if the source map is
|
||||
included within the sources.
|
||||
`filename` Name and/or location of the output source.
|
||||
`filename` Filename and/or location of the output source
|
||||
(sets `file` attribute in source map).
|
||||
`includeSources` Pass this flag if you want to include
|
||||
the content of source files in the
|
||||
source map as sourcesContent property.
|
||||
@@ -149,7 +150,9 @@ debugging your compressed JavaScript. To get a source map, pass
|
||||
|
||||
Additional options:
|
||||
|
||||
- `--source-map "filename='<NAME>'"` to specify the name of the source map.
|
||||
- `--source-map "filename='<NAME>'"` to specify the name of the source map. The value of
|
||||
`filename` is only used to set `file` attribute (see [the spec][sm-spec])
|
||||
in source map file.
|
||||
|
||||
- `--source-map "root='<URL>'"` to pass the URL where the original files can be found.
|
||||
|
||||
|
||||
@@ -1240,7 +1240,10 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
|
||||
function should_stop(node, parent) {
|
||||
if (node instanceof AST_Assign) return node.operator != "=" && lhs.equivalent_to(node.left);
|
||||
if (parent instanceof AST_For) return node !== parent.init;
|
||||
if (node instanceof AST_Assign) {
|
||||
return node.operator != "=" && lhs.equivalent_to(node.left);
|
||||
}
|
||||
if (node instanceof AST_Call) {
|
||||
return lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression);
|
||||
}
|
||||
@@ -1249,7 +1252,6 @@ merge(Compressor.prototype, {
|
||||
if (node instanceof AST_LoopControl) return true;
|
||||
if (node instanceof AST_Try) return true;
|
||||
if (node instanceof AST_With) return true;
|
||||
if (parent instanceof AST_For) return node !== parent.init;
|
||||
if (replace_all) return false;
|
||||
return node instanceof AST_SymbolRef && !node.is_declared(compressor);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "JavaScript parser, mangler/compressor and beautifier toolkit",
|
||||
"author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
|
||||
"license": "BSD-2-Clause",
|
||||
"version": "3.3.25",
|
||||
"version": "3.3.26",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
|
||||
@@ -4931,6 +4931,27 @@ collapse_rhs_lhs_2: {
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
collapse_rhs_loop: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
}
|
||||
input: {
|
||||
var s;
|
||||
s = "<tpl>PASS</tpl>";
|
||||
for (var m, r = /<tpl>(.*)<\/tpl>/; m = s.match(r);)
|
||||
s = s.replace(m[0], m[1]);
|
||||
console.log(s);
|
||||
}
|
||||
expect: {
|
||||
var s;
|
||||
s = "<tpl>PASS</tpl>";
|
||||
for (var m, r = /<tpl>(.*)<\/tpl>/; m = s.match(r);)
|
||||
s = s.replace(m[0], m[1]);
|
||||
console.log(s);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
collapse_rhs_side_effects: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
|
||||
Reference in New Issue
Block a user