readsState function

bool readsState(
  1. AstNode node,
  2. Element ctx
)

Whether node reads ctx.state of a SoloContext.

Implementation

bool readsState(AstNode node, Element ctx) {
  if (_getterOf(node, 'state') != ctx) return false;
  final target = node is PrefixedIdentifier
      ? node.prefix
      : (node as PropertyAccess).realTarget;
  return isSoloContext(target.staticType);
}