The previous implementations of `hasBaseClass()` are almost identical to the implementation of `getBaseClassExpression()`. There is little benefit in duplicating this code so this refactoring changes `hasBaseClass()` to just call `getBaseClassExpression()`. This allows the various hosts that implement this to be simplified. PR Close #36989