Sign In

terser

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terser - npm Package Compare versions

Comparing version
5.47.1
to
5.48.0
+4
-0
CHANGELOG.md
# Changelog
## v5.48.0
- Support `import source ...` and `import defer ...` (#1682)
## v5.47.1

@@ -4,0 +8,0 @@

@@ -61,2 +61,3 @@ /***********************************************************************

AST_Dot,
AST_DynamicImport,
AST_Expansion,

@@ -156,2 +157,8 @@ AST_Function,

def_drop_side_effect_free(AST_DynamicImport, function (compressor, first_in_statement) {
if (this.phase !== "source") return this;
var args = trim(this.args, compressor, first_in_statement);
return args && make_sequence(this, args);
});
def_drop_side_effect_free(AST_Accessor, return_null);

@@ -158,0 +165,0 @@

@@ -72,2 +72,3 @@ /***********************************************************************

AST_Import,
AST_DynamicImport,
AST_ImportMeta,

@@ -407,2 +408,6 @@ AST_Jump,

def_has_side_effects(AST_ImportMeta, return_false);
def_has_side_effects(AST_DynamicImport, function() {
// `import.source(x)` only compiles the module, which is side-effect free
return this.phase !== "source";
});
def_has_side_effects(AST_LabeledStatement, function(compressor) {

@@ -409,0 +414,0 @@ return this.body.has_side_effects(compressor);

@@ -32,2 +32,3 @@ import {

AST_Import,
AST_DynamicImport,
AST_ImportMeta,

@@ -197,3 +198,6 @@ AST_Jump,

AST_Import.prototype.shallow_cmp = function(other) {
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);
return (this.imported_name || null) === (other.imported_name || null)
&& (this.imported_names || null) === (other.imported_names || null)
&& (this.attributes || null) === (other.attributes || null)
&& (this.phase || null) === (other.phase || null);
};

@@ -203,2 +207,6 @@

AST_DynamicImport.prototype.shallow_cmp = function(other) {
return (this.phase || null) === (other.phase || null) && this.args.length === other.args.length;
};
AST_Export.prototype.shallow_cmp = function(other) {

@@ -205,0 +213,0 @@ 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;

@@ -38,2 +38,3 @@ import {

AST_Import,
AST_DynamicImport,
AST_ImportMeta,

@@ -280,2 +281,7 @@ AST_Infinity,

AST_DynamicImport.prototype._size = function () {
// `import.` + phase + `()` + arg overhead
return 9 + this.phase.length + list_overhead(this.args);
};
AST_Export.prototype._size = function () {

@@ -282,0 +288,0 @@ let size = 7 + (this.is_default ? 8 : 0);

+1
-1

@@ -7,3 +7,3 @@ {

"license": "BSD-2-Clause",
"version": "5.47.1",
"version": "5.48.0",
"engines": {

@@ -10,0 +10,0 @@ "node": ">=10"

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display