visitIndexSetExpr method

  1. @override
Object? visitIndexSetExpr(
  1. IndexSet expr
)
override

Implementation

@override
Object? visitIndexSetExpr(Expr.IndexSet expr) {
  Object? object = evaluate(expr.object);
  Object? index = evaluate(expr.name);
  Object? value = evaluate(expr.value);
  if (object is Map) {
    object[index] = value;
    return value;
  }
  return null;
}