fix(javascript): retain implicit property conversion and disposal effects

This commit is contained in:
morluto committed 2026-10-24 02:41:05 +08:00
1 parent 44efd920c6
commit 905ae18451
9 files changed
+569 -68

No files matched your search

@@ -401,12 +401,15 @@ export const expandSemanticGetterResult = (
/** Project an effect operand through the same local aliases and `this` owner as getter results. */
export const semanticGetterReceiverPaths = (
getter: t.ObjectMethod,
getter: t.ObjectMethod | t.ClassMethod,
operand: t.Node,
state: JavaScriptSemanticAnalysisState,
): readonly PropertyPath[] => {
const owner = state.parentsByNode.get(getter);
if (!t.isObjectExpression(owner)) return [];
const parent = state.parentsByNode.get(getter);
const owner = t.isClassBody(parent)
? state.parentsByNode.get(parent)
: parent;
if (!t.isObjectExpression(owner) && !t.isClass(owner)) return [];
const query = new SemanticGetterQuery(state);
const references = query.run(
() => {
@@ -419,7 +422,7 @@ export const semanticGetterReceiverPaths = (
query,
{
objectReferences: (_receiver, path) => [{ node: getter, path }],
classReferences: () => [],
classReferences: (_lookup, path) => [{ node: getter, path }],
privateReceiver: () => false,
bases: () => [],
containerReferences: (node, path) =>