Skip to content

Commit

Permalink
fix: inner graph
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 24, 2024
1 parent 5a9ed6d commit 28948dd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/optimize/InnerGraphPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class InnerGraphPlugin {
decl.init &&
decl.id.type === "Identifier"
) {
parser.walkExpression(decl.init);
const name = decl.id.name;
if (
decl.init.type === "ClassExpression" &&
Expand All @@ -178,7 +177,6 @@ class InnerGraphPlugin {
) {
pureDeclarators.add(decl);
}
return true;
}
}
});
Expand Down Expand Up @@ -243,7 +241,6 @@ class InnerGraphPlugin {
statement.id ? statement.id.range[1] : statement.range[0]
)
) {
console.log("classExtendsExpression");
InnerGraph.setTopLevelSymbol(parser.state, fn);
onUsageSuper(expr);
}
Expand Down Expand Up @@ -338,6 +335,15 @@ class InnerGraphPlugin {
parser.walkExpression(decl.init);
InnerGraph.setTopLevelSymbol(parser.state, undefined);
return true;
} else if (
decl.id.type === "Identifier" &&
decl.init &&
decl.init.type === "ClassExpression" &&
classWithTopLevelSymbol.has(decl.init)
) {
parser.walkExpression(decl.init);
InnerGraph.setTopLevelSymbol(parser.state, undefined);
return true;
}
});

Expand Down

0 comments on commit 28948dd

Please sign in to comment.