Comparing version 5.17.2 to 5.17.3
# Changelog | ||
## v5.17.3 | ||
- Fix issue with trimming a static class property's contents accessing the class as `this`. | ||
## v5.17.2 | ||
@@ -4,0 +8,0 @@ - Be less conservative when detecting use-before-definition of `var` in hoisted functions. |
@@ -168,2 +168,11 @@ /*********************************************************************** | ||
if ( | ||
prop instanceof AST_ClassProperty | ||
&& prop.static | ||
&& prop.value.has_side_effects(compressor) | ||
&& prop.contains_this() | ||
) { | ||
return this; | ||
} | ||
const trimmed_prop = prop.drop_side_effect_free(compressor); | ||
@@ -170,0 +179,0 @@ if (trimmed_prop) |
@@ -87,2 +87,3 @@ /*********************************************************************** | ||
AST_Return, | ||
AST_Scope, | ||
AST_Sequence, | ||
@@ -954,2 +955,15 @@ AST_SimpleStatement, | ||
AST_Node.DEFMETHOD("contains_this", function() { | ||
return walk(this, node => { | ||
if (node instanceof AST_This) return walk_abort; | ||
if ( | ||
node !== this | ||
&& node instanceof AST_Scope | ||
&& !(node instanceof AST_Arrow) | ||
) { | ||
return true; | ||
} | ||
}); | ||
}); | ||
export function is_modified(compressor, tw, node, value, level, immutable) { | ||
@@ -956,0 +970,0 @@ var parent = tw.parent(level); |
@@ -7,3 +7,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "5.17.2", | ||
"version": "5.17.3", | ||
"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
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
2083405
59253