mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[hir] Skip only MemberExpressions
Identifiers don't need skipping anyways, so this doesn't affect the existing behavior. In the future, we will special case handling of LHS of AssignmentExpression which will require us to not skip the RHS.
This commit is contained in:
1 parent
f17f4dcf0b
commit
99eb48db07
1 file changed
+8
-5
@@ -2174,13 +2174,16 @@ function gatherCapturedDeps(
|
||||
return;
|
||||
}
|
||||
|
||||
// For CallExpression, we need to depend on the receiver, not the
|
||||
// function itself.
|
||||
if (path.parent.type === "CallExpression" && path.isMemberExpression()) {
|
||||
path = path.get("object");
|
||||
if (path.isMemberExpression()) {
|
||||
// For CallExpression, we need to depend on the receiver, not the
|
||||
// function itself.
|
||||
if (path.parent.type === "CallExpression") {
|
||||
path = path.get("object");
|
||||
}
|
||||
|
||||
path.skip();
|
||||
}
|
||||
|
||||
path.skip();
|
||||
capturedIds.add(binding.identifier);
|
||||
capturedRefs.add(lowerExpressionToTemporary(builder, path));
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user