Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,23 @@ fn is_read(current_node_id: NodeId, nodes: &AstNodes) -> bool {
matches!(grand_parent_node.kind(), AstKind::CallExpression(_))
});

return is_parent_inside_call_expression;
if is_parent_inside_call_expression {
return true;
}

if matches!(
assign_expr.operator,
AssignmentOperator::LogicalOr
| AssignmentOperator::LogicalAnd
| AssignmentOperator::LogicalNullish
) {
return !matches!(
nodes.parent_kind(parent.id()),
AstKind::ExpressionStatement(_)
);
}

return false;
}
(
AstKind::ArrayAssignmentTarget(_) | AstKind::ObjectAssignmentTarget(_),
Expand Down Expand Up @@ -325,6 +341,7 @@ fn test() {
callback;
}
}",
r"class ChildProcess extends EventEmitter { #stdioObject; #createStdioObject() {} get stdio() { return (this.#stdioObject ??= this.#createStdioObject()); } }",
];

let fail = vec![
Expand Down
Loading