visitReadVarExpr method
Implementation
@override
void visitReadVarExpr(o.ReadVarExpr ast, EmitterVisitorContext context) {
var varName = ast.name;
if (ast.builtin != null) {
switch (ast.builtin) {
case o.BuiltinVar.superVar:
varName = 'super';
break;
case o.BuiltinVar.thisVar:
varName = 'this';
break;
case o.BuiltinVar.catchErrorVar:
varName = catchErrorVar.name;
break;
case o.BuiltinVar.catchStackVar:
varName = catchStackVar.name;
break;
case o.BuiltinVar.metadataMapVar:
varName = 'null';
break;
default:
throw StateError('Unknown builtin variable ${ast.builtin}');
}
}
context.print(varName!);
}