memberGet method
dynamic
memberGet(})
override
Fetch a member by the id, in the form of
object.id
id must be of String type.
Implementation
@override
dynamic memberGet(String id,
{String? from, bool isRecursive = false, bool ignoreUndefined = false}) {
if (externalClass != null) {
dynamic member = externalClass!.instanceMemberGet(externalObject, id);
if (member is Function) {
HTClass? currentKlass = klass!;
HTFunction? decl;
while (decl == null && currentKlass != null) {
decl = currentKlass.memberGet(id, ignoreUndefined: true);
currentKlass = currentKlass.superClass;
}
assert(decl != null,
'Could not find hetu declaration on external id: $typeString.$id');
decl = decl!.clone();
// Assign the value as if we are doing decl.resolve() here.
decl.externalFunc = member;
decl.instance = externalObject;
return decl;
} else {
return member;
}
}
if (!ignoreUndefined) {
throw HTError.undefined(id);
}
}