[dart2js] cleanup element_map_impl

Small follow up cleanup in element_map_impl addressing comments from the
previous code review.

Change-Id: I1eea8bba35575b953de4686351e60f0cbf353d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260066
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
This commit is contained in:
Sigmund Cherem 2022-09-20 20:09:05 +00:00 committed by Commit Bot
parent 755f124fcd
commit 3add88c955

View file

@ -1521,12 +1521,12 @@ class JsKernelToElementMap
}
@override
FunctionEntity getSuperNoSuchMethod(ClassEntity? cls) {
while (cls != null) {
cls = elementEnvironment.getSuperClass(cls);
if (cls == null) break;
MemberEntity? member =
elementEnvironment.lookupLocalClassMember(cls, Names.noSuchMethod_);
FunctionEntity getSuperNoSuchMethod(ClassEntity cls) {
while (true) {
ClassEntity? superclass = elementEnvironment.getSuperClass(cls);
if (superclass == null) break;
MemberEntity? member = elementEnvironment.lookupLocalClassMember(
superclass, Names.noSuchMethod_);
if (member != null && !member.isAbstract) {
if (member.isFunction) {
final function = member as FunctionEntity;
@ -1538,6 +1538,7 @@ class JsKernelToElementMap
// `Object.superNoSuchMethod`.
break;
}
cls = superclass;
}
return elementEnvironment.lookupLocalClassMember(
commonElements.objectClass, Names.noSuchMethod_)! as FunctionEntity;