Socket
Socket
Sign inDemoInstall

terser

Package Overview
Dependencies
Maintainers
1
Versions
176
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.31.1 to 5.31.2

5

CHANGELOG.md
# Changelog
## v5.31.2
- drop_unused: scan variables in self-referential class declarations that contain side effects.
- Don't add parens to arrow function when it's the default for an argument (#1540)
- Update domprops (#1538)
## v5.31.1

@@ -4,0 +9,0 @@ - Allow drop-unused to drop the whole assignment (not just the assigned name) in more situations, in order to avoid duplication of long strings.

11

lib/compress/drop-unused.js

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

var initializations = new Map();
var self_referential_classes = new Set();

@@ -158,4 +157,7 @@ // pass 1: find out which symbols are directly used in

if (node instanceof AST_Class && node.has_side_effects(compressor)) {
if (node.is_self_referential()) self_referential_classes.add(node);
node.visit_nondeferred_class_parts(tw);
if (node.is_self_referential()) {
descend();
} else {
node.visit_nondeferred_class_parts(tw);
}
}

@@ -224,5 +226,2 @@ if (node instanceof AST_Defun || node instanceof AST_DefClass) {

});
self_referential_classes.forEach(function (cls) {
cls.walk(tw);
});
// pass 3: we should drop declarations not in_use

@@ -229,0 +228,0 @@ var tt = new TreeTransformer(

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc