Socket
Socket
Sign inDemoInstall

terser

Package Overview
Dependencies
Maintainers
1
Versions
180
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.16.5 to 5.16.6

5

CHANGELOG.md
# Changelog
## v5.16.7
- Become less conservative with analyzing function definitions for `reduce_vars`
- Parse `import.meta` as a real AST node and not an `object.property`
## v5.16.5

@@ -4,0 +9,0 @@

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

AST_Import,
AST_ImportMeta,
AST_Jump,

@@ -314,2 +315,3 @@ AST_LabeledStatement,

});
def_has_side_effects(AST_ImportMeta, return_false);
def_has_side_effects(AST_LabeledStatement, function(compressor) {

@@ -418,2 +420,3 @@ return this.body.has_side_effects(compressor);

def_may_throw(AST_This, return_false);
def_may_throw(AST_ImportMeta, return_false);

@@ -782,2 +785,7 @@ function any(list, compressor) {

});
def_find_defs(AST_ImportMeta, function(compressor, suffix) {
var defines = compressor.option("global_defs");
var name = "import.meta" + suffix;
if (HOP(defines, name)) return to_node(defines[name], this);
});
})(function(node, func) {

@@ -784,0 +792,0 @@ node.DEFMETHOD("_find_defs", func);

18

lib/compress/reduce-vars.js

@@ -451,11 +451,3 @@ /***********************************************************************

// Sometimes we detach the lambda for safety, and instead of push()
// we go to an entirely fresh lineage of safe_ids.
let previous_safe_ids;
if (this instanceof AST_Defun || this.uses_arguments || this.pinned()) {
previous_safe_ids = tw.safe_ids;
tw.safe_ids = Object.create(null);
} else {
push(tw);
}
push(tw);

@@ -492,10 +484,6 @@ reset_variables(tw, compressor, this);

}
descend();
pop(tw);
if (previous_safe_ids) {
tw.safe_ids = previous_safe_ids;
} else {
pop(tw);
}
return true;

@@ -502,0 +490,0 @@ }

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

"license": "BSD-2-Clause",
"version": "5.16.5",
"version": "5.16.6",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc