mirror of
https://github.com/morluto/rea.git
synced 2026-10-29 10:55:57 +00:00
perf(javascript): analyze member chains without recursive copying (#932)
* fix(javascript): traverse deep semantic member chains iteratively * fix(javascript): preserve deep initializer and pattern analysis
This commit is contained in:
1 parent
e6ba9c3af3
commit
dcde958450
7 files changed
+287
-116
No files matched your search
@@ -39,11 +39,18 @@ export const collectSemanticMemberMutations = (
|
||||
return;
|
||||
}
|
||||
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
||||
markValue(
|
||||
node.object,
|
||||
[semanticStaticPropertyKey(node.property, node.computed), ...path],
|
||||
bindings,
|
||||
);
|
||||
const members: (string | null)[] = [];
|
||||
let current: t.Node = node;
|
||||
while (
|
||||
t.isMemberExpression(current) ||
|
||||
t.isOptionalMemberExpression(current)
|
||||
) {
|
||||
members.push(
|
||||
semanticStaticPropertyKey(current.property, current.computed),
|
||||
);
|
||||
current = current.object;
|
||||
}
|
||||
markValue(current, [...members.reverse(), ...path], bindings);
|
||||
return;
|
||||
}
|
||||
for (const value of referencedValues(node, path))
|
||||
|
||||
Reference in new issue
Block a user