visitMemberExpr method

  1. @override
Uint8List visitMemberExpr(
  1. MemberExpr expr
)
override

Implementation

@override
Uint8List visitMemberExpr(MemberExpr expr) {
  final bytesBuilder = BytesBuilder();
  final object = compileAST(expr.object);
  bytesBuilder.add(object);
  bytesBuilder.addByte(HTOpCode.register);
  bytesBuilder.addByte(HTRegIdx.postfixObject);
  bytesBuilder.addByte(HTOpCode.memberGet);
  bytesBuilder.addByte(expr.isNullable ? 1 : 0);
  final key = compileAST(expr.key, endOfExec: true);
  bytesBuilder.add(_uint16(key.length));
  bytesBuilder.add(key);
  return bytesBuilder.toBytes();
}