visitReadVarExpr method

  1. @override
Expression visitReadVarExpr(
  1. ReadVarExpr ast,
  2. void context
)
override

Implementation

@override
o.Expression visitReadVarExpr(o.ReadVarExpr ast, void context) {
  if (ast is ReadNodeReferenceExpr) {
    var node = ast.node;
    NodeReferenceStorageVisitor? visitor = this;
    while (visitor != null && !visitor.scope.contains(node)) {
      visitor = visitor.parent;
    }
    if (visitor == null) node.promoteToClassMember();
  }
  return ast;
}