Comparing version 5.15.1 to 5.16.0
# Changelog | ||
## v5.16.1 | ||
- Disallow private fields in object bodies (#1011) | ||
- Parse `#privatefield in object` (#1279) | ||
- Compress `#privatefield in object` | ||
## v5.15.1 | ||
@@ -4,0 +10,0 @@ |
@@ -116,2 +116,3 @@ /*********************************************************************** | ||
AST_PrivateSetter, | ||
AST_PrivateIn, | ||
AST_PropAccess, | ||
@@ -132,2 +133,3 @@ AST_RegExp, | ||
AST_SymbolClassProperty, | ||
AST_SymbolPrivateProperty, | ||
AST_SymbolConst, | ||
@@ -437,3 +439,5 @@ AST_SymbolDefClass, | ||
} else { | ||
if (M.key.type !== "Identifier") throw new Error("Non-Identifier key in PropertyDefinition"); | ||
if (M.key.type !== "Identifier" && M.key.type !== "PrivateIdentifier") { | ||
throw new Error("Non-Identifier key in PropertyDefinition"); | ||
} | ||
key = from_moz(M.key); | ||
@@ -873,2 +877,14 @@ } | ||
BinaryExpression: function(M) { | ||
if (M.left.type === "PrivateIdentifier") { | ||
return new AST_PrivateIn({ | ||
start: my_start_token(M), | ||
end: my_end_token(M), | ||
key: new AST_SymbolPrivateProperty({ | ||
start: my_start_token(M.left), | ||
end: my_end_token(M.left), | ||
name: M.left.name | ||
}), | ||
value: from_moz(M.right), | ||
}); | ||
} | ||
return new AST_Binary({ | ||
@@ -1458,2 +1474,11 @@ start: my_start_token(M), | ||
def_to_moz(AST_PrivateIn, function To_Moz_BinaryExpression_PrivateIn(M) { | ||
return { | ||
type: "BinaryExpression", | ||
left: { type: "PrivateIdentifier", name: M.key.name }, | ||
operator: "in", | ||
right: to_moz(M.value), | ||
}; | ||
}); | ||
def_to_moz(AST_Array, function To_Moz_ArrayExpression(M) { | ||
@@ -1460,0 +1485,0 @@ return { |
@@ -64,2 +64,3 @@ /*********************************************************************** | ||
AST_PrivateSetter, | ||
AST_PrivateIn, | ||
AST_Sequence, | ||
@@ -157,2 +158,3 @@ AST_String, | ||
|| node instanceof AST_PrivateSetter | ||
|| node instanceof AST_PrivateIn | ||
) { | ||
@@ -159,0 +161,0 @@ node.key.name = mangle_private(node.key.name); |
@@ -56,2 +56,3 @@ import { | ||
AST_PrivateSetter, | ||
AST_PrivateIn, | ||
AST_RegExp, | ||
@@ -399,2 +400,6 @@ AST_Return, | ||
AST_PrivateIn.prototype._size = function () { | ||
return 5; // "#", and " in " | ||
}; | ||
AST_Class.prototype._size = function () { | ||
@@ -401,0 +406,0 @@ return ( |
@@ -50,2 +50,3 @@ /*********************************************************************** | ||
AST_Binary, | ||
AST_PrivateIn, | ||
AST_Block, | ||
@@ -263,2 +264,7 @@ AST_Call, | ||
def_transform(AST_PrivateIn, function(self, tw) { | ||
self.key = self.key.transform(tw); | ||
self.value = self.value.transform(tw); | ||
}); | ||
def_transform(AST_Conditional, function(self, tw) { | ||
@@ -265,0 +271,0 @@ self.condition = self.condition.transform(tw); |
@@ -7,3 +7,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "5.15.1", | ||
"version": "5.16.0", | ||
"engines": { | ||
@@ -10,0 +10,0 @@ "node": ">=10" |
# Our patrons | ||
These are the first-tier patrons from [Patreon](https://www.patreon.com/fabiosantoscode). My appreciation goes to everyone on this list for supporting the project! | ||
These are the first-tier patrons from Patreon (notice: **The Terser Patreon is shutting down in favor of opencollective**). My appreciation goes to everyone on this list for supporting the project! | ||
@@ -5,0 +5,0 @@ * 38elements |
@@ -10,3 +10,3 @@ <h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1> | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/fabiosantoscode"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. | ||
*note*: <s>You can support this project on patreon: [link]</s> **The Terser Patreon is shutting down in favor of opencollective**. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. | ||
@@ -1340,3 +1340,3 @@ Terser recommends you use RollupJS to bundle your modules, as that produces smaller code overall. | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/fabiosantoscode"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. | ||
*note*: <s>You can support this project on patreon: [link]</s> **The Terser Patreon is shutting down in favor of opencollective**. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons. | ||
@@ -1343,0 +1343,0 @@ These are the second-tier patrons. Great thanks for your support! |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2049558
58432