terser 5.40.0 → 5.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/bundle.min.js +445 -252
- package/lib/ast.js +10 -10
- package/lib/equivalent-to.js +6 -3
- package/lib/mozilla-ast.js +355 -197
- package/lib/output.js +10 -6
- package/lib/parse.js +65 -37
- package/package.json +1 -1
package/lib/ast.js
CHANGED
@@ -2179,7 +2179,6 @@ var AST_ConciseMethod = DEFNODE("ConciseMethod", "quote static is_generator asyn
|
|
2179
2179
|
|
2180
2180
|
var AST_PrivateMethod = DEFNODE("PrivateMethod", "", function AST_PrivateMethod(props) {
|
2181
2181
|
if (props) {
|
2182
|
-
this.quote = props.quote;
|
2183
2182
|
this.static = props.static;
|
2184
2183
|
this.is_generator = props.is_generator;
|
2185
2184
|
this.async = props.async;
|
@@ -2340,7 +2339,6 @@ var AST_ClassProperty = DEFNODE("ClassProperty", "static quote", function AST_Cl
|
|
2340
2339
|
var AST_ClassPrivateProperty = DEFNODE("ClassPrivateProperty", "", function AST_ClassPrivateProperty(props) {
|
2341
2340
|
if (props) {
|
2342
2341
|
this.static = props.static;
|
2343
|
-
this.quote = props.quote;
|
2344
2342
|
this.key = props.key;
|
2345
2343
|
this.value = props.value;
|
2346
2344
|
this.start = props.start;
|
@@ -2700,12 +2698,12 @@ var AST_SymbolImport = DEFNODE("SymbolImport", null, function AST_SymbolImport(p
|
|
2700
2698
|
$documentation: "Symbol referring to an imported name",
|
2701
2699
|
}, AST_SymbolBlockDeclaration);
|
2702
2700
|
|
2703
|
-
var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign",
|
2701
|
+
var AST_SymbolImportForeign = DEFNODE("SymbolImportForeign", "quote", function AST_SymbolImportForeign(props) {
|
2704
2702
|
if (props) {
|
2703
|
+
this.quote = props.quote;
|
2705
2704
|
this.scope = props.scope;
|
2706
2705
|
this.name = props.name;
|
2707
2706
|
this.thedef = props.thedef;
|
2708
|
-
this.quote = props.quote;
|
2709
2707
|
this.start = props.start;
|
2710
2708
|
this.end = props.end;
|
2711
2709
|
}
|
@@ -2752,12 +2750,12 @@ var AST_SymbolRef = DEFNODE("SymbolRef", null, function AST_SymbolRef(props) {
|
|
2752
2750
|
$documentation: "Reference to some symbol (not definition/declaration)",
|
2753
2751
|
}, AST_Symbol);
|
2754
2752
|
|
2755
|
-
var AST_SymbolExport = DEFNODE("SymbolExport",
|
2753
|
+
var AST_SymbolExport = DEFNODE("SymbolExport", "quote", function AST_SymbolExport(props) {
|
2756
2754
|
if (props) {
|
2755
|
+
this.quote = props.quote;
|
2757
2756
|
this.scope = props.scope;
|
2758
2757
|
this.name = props.name;
|
2759
2758
|
this.thedef = props.thedef;
|
2760
|
-
this.quote = props.quote;
|
2761
2759
|
this.start = props.start;
|
2762
2760
|
this.end = props.end;
|
2763
2761
|
}
|
@@ -2767,12 +2765,12 @@ var AST_SymbolExport = DEFNODE("SymbolExport", null, function AST_SymbolExport(p
|
|
2767
2765
|
$documentation: "Symbol referring to a name to export",
|
2768
2766
|
}, AST_SymbolRef);
|
2769
2767
|
|
2770
|
-
var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign",
|
2768
|
+
var AST_SymbolExportForeign = DEFNODE("SymbolExportForeign", "quote", function AST_SymbolExportForeign(props) {
|
2771
2769
|
if (props) {
|
2770
|
+
this.quote = props.quote;
|
2772
2771
|
this.scope = props.scope;
|
2773
2772
|
this.name = props.name;
|
2774
2773
|
this.thedef = props.thedef;
|
2775
|
-
this.quote = props.quote;
|
2776
2774
|
this.start = props.start;
|
2777
2775
|
this.end = props.end;
|
2778
2776
|
}
|
@@ -2887,9 +2885,10 @@ var AST_Number = DEFNODE("Number", "value raw", function AST_Number(props) {
|
|
2887
2885
|
}
|
2888
2886
|
}, AST_Constant);
|
2889
2887
|
|
2890
|
-
var AST_BigInt = DEFNODE("BigInt", "value", function AST_BigInt(props) {
|
2888
|
+
var AST_BigInt = DEFNODE("BigInt", "value raw", function AST_BigInt(props) {
|
2891
2889
|
if (props) {
|
2892
2890
|
this.value = props.value;
|
2891
|
+
this.raw = props.raw;
|
2893
2892
|
this.start = props.start;
|
2894
2893
|
this.end = props.end;
|
2895
2894
|
}
|
@@ -2898,7 +2897,8 @@ var AST_BigInt = DEFNODE("BigInt", "value", function AST_BigInt(props) {
|
|
2898
2897
|
}, {
|
2899
2898
|
$documentation: "A big int literal",
|
2900
2899
|
$propdoc: {
|
2901
|
-
value: "[string] big int value"
|
2900
|
+
value: "[string] big int value, represented as a string",
|
2901
|
+
raw: "[string] the original format preserved"
|
2902
2902
|
}
|
2903
2903
|
}, AST_Constant);
|
2904
2904
|
|
package/lib/equivalent-to.js
CHANGED
@@ -44,6 +44,7 @@ import {
|
|
44
44
|
AST_ObjectProperty,
|
45
45
|
AST_ObjectSetter,
|
46
46
|
AST_PrefixedTemplateString,
|
47
|
+
AST_PrivateIn,
|
47
48
|
AST_PrivateMethod,
|
48
49
|
AST_PropAccess,
|
49
50
|
AST_RegExp,
|
@@ -192,13 +193,13 @@ AST_VarDef.prototype.shallow_cmp = function(other) {
|
|
192
193
|
AST_NameMapping.prototype.shallow_cmp = pass_through;
|
193
194
|
|
194
195
|
AST_Import.prototype.shallow_cmp = function(other) {
|
195
|
-
return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names);
|
196
|
+
return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes);
|
196
197
|
};
|
197
198
|
|
198
199
|
AST_ImportMeta.prototype.shallow_cmp = pass_through;
|
199
200
|
|
200
201
|
AST_Export.prototype.shallow_cmp = function(other) {
|
201
|
-
return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && this.module_name === other.module_name && this.is_default === other.is_default;
|
202
|
+
return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes) && this.module_name === other.module_name && this.is_default === other.is_default;
|
202
203
|
};
|
203
204
|
|
204
205
|
AST_Call.prototype.shallow_cmp = pass_through;
|
@@ -225,6 +226,8 @@ AST_Binary.prototype.shallow_cmp = function(other) {
|
|
225
226
|
return this.operator === other.operator;
|
226
227
|
};
|
227
228
|
|
229
|
+
AST_PrivateIn.prototype.shallow_cmp = pass_through;
|
230
|
+
|
228
231
|
AST_Conditional.prototype.shallow_cmp = pass_through;
|
229
232
|
|
230
233
|
AST_Array.prototype.shallow_cmp = pass_through;
|
@@ -234,7 +237,7 @@ AST_Object.prototype.shallow_cmp = pass_through;
|
|
234
237
|
AST_ObjectProperty.prototype.shallow_cmp = pass_through;
|
235
238
|
|
236
239
|
AST_ObjectKeyVal.prototype.shallow_cmp = function(other) {
|
237
|
-
return this.key === other.key;
|
240
|
+
return this.key === other.key && this.quote === other.quote;
|
238
241
|
};
|
239
242
|
|
240
243
|
AST_ObjectSetter.prototype.shallow_cmp = function(other) {
|