mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
fix(javascript): unwrap pure SequenceExpression call targets (#14396)
* fix(javascript): unwrap pure SequenceExpression call targets * fix(javascript): scope sequence aliases to valueExpressionLocation * fix(javascript): preserve sequence initializer value and alias flows --------- Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
This commit is contained in:
1 parent
c536c67ee1
commit
c9831a9d4f
16 files changed
+749
-22
No files matched your search
@@ -1022,6 +1022,8 @@ const projectCalls = (context: FileContext): void => {
|
||||
candidate_node_ids: [],
|
||||
evidence: unknownSemanticEvidence(context.file, argument.location),
|
||||
});
|
||||
const valueLocation =
|
||||
argument.valueExpressionLocation ?? argument.location;
|
||||
const references =
|
||||
argument.valueExpressionLocation !== null &&
|
||||
expressions.has(
|
||||
@@ -1029,7 +1031,7 @@ const projectCalls = (context: FileContext): void => {
|
||||
)
|
||||
? []
|
||||
: context
|
||||
.referenceNodesWithin(argument.location)
|
||||
.referenceNodesWithin(valueLocation)
|
||||
.filter(
|
||||
(reference) =>
|
||||
reference.function_node_id === callNode.function_node_id,
|
||||
@@ -1041,7 +1043,7 @@ const projectCalls = (context: FileContext): void => {
|
||||
relation: "aliases",
|
||||
resolution:
|
||||
references.length === 1 &&
|
||||
rangesEqual(reference.identity.source_range, argument.location)
|
||||
rangesEqual(reference.identity.source_range, valueLocation)
|
||||
? "resolved"
|
||||
: "candidate",
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user