Socket
Socket
Sign inDemoInstall

terser

Package Overview
Dependencies
11
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.17.5 to 5.17.6

5

CHANGELOG.md
# Changelog
## v5.17.6
- Fixes to mozilla AST input and output, for class properties, private properties and static blocks
- Fix outputting a shorthand property in quotes when safari10 and ecma=2015 options are enabled
- `configurable` and `enumerable`, used in Object.defineProperty, added to domprops (#1393)
## v5.17.5

@@ -4,0 +9,0 @@ - Take into account the non-deferred bits of a class, such as static properties, while dropping unused code.

38

lib/mozilla-ast.js

@@ -398,6 +398,9 @@ /***********************************************************************

MethodDefinition: function(M) {
const is_private = M.key.type === "PrivateIdentifier";
const key = M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value });
var args = {
start : my_start_token(M),
end : my_end_token(M),
key : M.computed ? from_moz(M.key) : new AST_SymbolMethod({ name: M.key.name || M.key.value }),
key,
value : from_moz(M.value),

@@ -407,10 +410,10 @@ static : M.static,

if (M.kind == "get") {
return new AST_ObjectGetter(args);
return new (is_private ? AST_PrivateGetter : AST_ObjectGetter)(args);
}
if (M.kind == "set") {
return new AST_ObjectSetter(args);
return new (is_private ? AST_PrivateSetter : AST_ObjectSetter)(args);
}
args.is_generator = M.value.generator;
args.async = M.value.async;
return new AST_ConciseMethod(args);
return new (is_private ? AST_PrivateMethod : AST_ConciseMethod)(args);
},

@@ -439,4 +442,12 @@

key = from_moz(M.key);
} else if (M.key.type === "PrivateIdentifier") {
return new AST_ClassPrivateProperty({
start : my_start_token(M),
end : my_end_token(M),
key : from_moz(M.key),
value : from_moz(M.value),
static : M.static,
});
} else {
if (M.key.type !== "Identifier" && M.key.type !== "PrivateIdentifier") {
if (M.key.type !== "Identifier") {
throw new Error("Non-Identifier key in PropertyDefinition");

@@ -456,2 +467,10 @@ }

PrivateIdentifier: function (M) {
return new AST_SymbolPrivateProperty({
start: my_start_token(M),
end: my_end_token(M),
name: M.name
});
},
StaticBlock: function(M) {

@@ -498,2 +517,11 @@ return new AST_ClassStaticBlock({

MemberExpression: function(M) {
if (M.property.type === "PrivateIdentifier") {
return new AST_DotHash({
start : my_start_token(M),
end : my_end_token(M),
property : M.property.name,
expression : from_moz(M.object),
optional : M.optional || false
});
}
return new (M.computed ? AST_Sub : AST_Dot)({

@@ -500,0 +528,0 @@ start : my_start_token(M),

2

package.json

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

"license": "BSD-2-Clause",
"version": "5.17.5",
"version": "5.17.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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc