fix corner case in inline (#5845)

fixes #5841
This commit is contained in:
Alex Lam S.L
2024-06-17 02:08:53 +03:00
committed by GitHub
parent 0934c0e431
commit dc51a23d31
2 changed files with 103 additions and 3 deletions

View File

@@ -185,7 +185,7 @@ function Compressor(options, false_by_default) {
};
}
Compressor.prototype = new TreeTransformer(function(node, descend, in_list) {
Compressor.prototype = new TreeTransformer(function(node, descend) {
if (node._squeezed) return node;
var is_scope = node instanceof AST_Scope;
if (is_scope) {
@@ -270,7 +270,7 @@ Compressor.prototype.compress = function(node) {
};
(function(OPT) {
OPT(AST_Node, function(self, compressor) {
OPT(AST_Node, function(self) {
return self;
});
@@ -10926,7 +10926,7 @@ Compressor.prototype.compress = function(node) {
if (can_substitute_directly()) {
var args = self.args.slice();
var refs = [];
var retValue = value.clone(true).transform(new TreeTransformer(function(node) {
var retValue = value.optimize(compressor).clone(true).transform(new TreeTransformer(function(node) {
if (node instanceof AST_SymbolRef) {
var def = node.definition();
if (fn.variables.get(node.name) !== def) {