ensure Object is always last in the list of inherited types

This commit is contained in:
Dave Holoway
2020-06-25 10:56:02 +01:00
parent 69e77eae8a
commit b0a2475696

View File

@@ -365,7 +365,13 @@ function getTypeInheritanceList(type) {
/** @type {Set<JavaType>} */
done: new Set(),
};
let object = null;
for (let type; type = types.list.shift(); ) {
// always add Object last
if (type.rawTypeSignature === 'Ljava/lang/Object;') {
object = type;
continue;
}
if (types.done.has(type)) {
continue;
}
@@ -373,6 +379,9 @@ function getTypeInheritanceList(type) {
if (type instanceof CEIType)
types.list.push(...type.supers);
}
if (object) {
types.done.add(object);
}
return Array.from(types.done);
}