uglify-js
Advanced tools
Comparing version 3.17.0 to 3.17.1
@@ -208,2 +208,3 @@ "use strict"; | ||
if (timings) timings.properties = Date.now(); | ||
if (quoted_props) reserve_quoted_keys(toplevel, quoted_props); | ||
if (options.mangle && options.mangle.properties) mangle_properties(toplevel, options.mangle.properties); | ||
@@ -210,0 +211,0 @@ if (options.parse.expression) toplevel = toplevel.unwrap_expression(); |
@@ -129,2 +129,4 @@ /*********************************************************************** | ||
if (node.start && node.start.quote) add(node.key); | ||
} else if (node instanceof AST_Dot) { | ||
if (node.quoted) add(node.property); | ||
} else if (node instanceof AST_ObjectProperty) { | ||
@@ -264,4 +266,10 @@ if (node.start && node.start.quote) add(node.key); | ||
function should_mangle(name) { | ||
if (reserved.has(name)) return false; | ||
if (regex && !regex.test(name)) return false; | ||
if (reserved.has(name)) { | ||
AST_Node.info("Preserving reserved property {this}", name); | ||
return false; | ||
} | ||
if (regex && !regex.test(name)) { | ||
AST_Node.info("Preserving excluded property {this}", name); | ||
return false; | ||
} | ||
return cache.has(name) || names_to_mangle.has(name); | ||
@@ -291,2 +299,6 @@ } | ||
} | ||
AST_Node.info("Mapping property {name} to {mangled}", { | ||
mangled: mangled, | ||
name: name, | ||
}); | ||
return mangled; | ||
@@ -293,0 +305,0 @@ } |
@@ -372,4 +372,5 @@ /*********************************************************************** | ||
if (node instanceof AST_SymbolCatch) { | ||
var scope = node.thedef.defun; | ||
if (scope.name instanceof AST_SymbolLambda && scope.name.name == node.name) { | ||
var def = node.thedef; | ||
var scope = def.defun; | ||
if (def.name != "arguments" && scope.name instanceof AST_SymbolLambda && scope.name.name == def.name) { | ||
scope = scope.parent_scope.resolve(); | ||
@@ -376,0 +377,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "3.17.0", | ||
"version": "3.17.1", | ||
"engines": { | ||
@@ -9,0 +9,0 @@ "node": ">=0.8.0" |
@@ -330,3 +330,3 @@ UglifyJS 3 | ||
"foo": 1, | ||
bar: 3 | ||
bar: 3, | ||
}; | ||
@@ -343,2 +343,12 @@ o.foo += o.bar; | ||
If the minified output will be processed again by UglifyJS, consider specifying | ||
`keep_quoted_props` so the same property names are preserved: | ||
```bash | ||
$ uglifyjs stuff.js --mangle-props keep_quoted -c -m -O keep_quoted_props | ||
``` | ||
```javascript | ||
var o={"foo":1,o:3};o.foo+=o.o,console.log(o.foo); | ||
``` | ||
### Debugging property name mangling | ||
@@ -935,2 +945,5 @@ | ||
- `extendscript` (default: `false`) — enable workarounds for Adobe ExtendScript | ||
bugs | ||
- `galio` (default: `false`) — enable workarounds for ANT Galio bugs | ||
@@ -1452,1 +1465,15 @@ | ||
UglifyJS may modify the input which in turn may suppress those errors. | ||
- Adobe ExtendScript will give incorrect results with the following: | ||
```javascript | ||
alert(true ? "PASS" : false ? "FAIL" : null); | ||
// Expected: "PASS" | ||
// Actual: "FAIL" | ||
``` | ||
UglifyJS may modify the input which in turn may suppress those errors. | ||
- Adobe ExtendScript will give incorrect results with the following: | ||
```javascript | ||
alert(42 ? null ? "FAIL" : "PASS" : "FAIL"); | ||
// Expected: "PASS" | ||
// Actual: SyntaxError: Expected: : | ||
``` | ||
UglifyJS may modify the input which in turn may suppress those errors. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1276939
31900
1476