@@ -193,17 +193,7 @@ class SapDefineModule extends AmdModuleDefinition::Range, MethodCallExpr, UserMo
193193 /**
194194 * Gets the module defined with sap.ui.define that imports and extends (subclasses) this module.
195195 */
196- SapDefineModule getExtendingModule ( ) {
197- // exists(SapExtendCall baseExtendCall, SapExtendCall subclassExtendCall |
198- // baseExtendCall.getDefine() = this and
199- // result = subclassExtendCall.getDefine() and
200- // result
201- // .getRequiredObject(baseExtendCall.getName().replaceAll(".", "/"))
202- // .asSourceNode()
203- // .flowsTo(subclassExtendCall.getReceiver())
204- // )
205- none ( ) // TODO
206- }
196+ SapDefineModule getExtendingModule ( ) { result .getSuperModule ( _) = this }
207197
208198 /**
209199 * Gets the module that this module imports via path `importPath`.
@@ -291,7 +281,9 @@ class CustomControl extends SapExtendCall {
291281 CustomControl ( ) {
292282 this .getReceiver ( ) .getALocalSource ( ) =
293283 TypeTrackers:: hasDependency ( [ "sap/ui/core/Control" , "sap.ui.core.Control" ] ) or
294- exists ( SapDefineModule sapModule | this .getDefine ( ) = sapModule .getExtendingModule ( ) )
284+ exists ( CustomControl superControl |
285+ superControl .getDefine ( ) = this .getDefine ( ) .getSuperModule ( _)
286+ )
295287 }
296288
297289 CustomController getController ( ) { this = result .getAControlReference ( ) .getDefinition ( ) }
@@ -464,8 +456,14 @@ class CustomController extends SapExtendCall {
464456 string name ;
465457
466458 CustomController ( ) {
467- this .getReceiver ( ) .getALocalSource ( ) =
468- TypeTrackers:: hasDependency ( [ "sap/ui/core/mvc/Controller" , "sap.ui.core.mvc.Controller" ] ) and
459+ (
460+ this .getReceiver ( ) .getALocalSource ( ) =
461+ TypeTrackers:: hasDependency ( [ "sap/ui/core/mvc/Controller" , "sap.ui.core.mvc.Controller" ] )
462+ or
463+ exists ( CustomController superController |
464+ superController .getDefine ( ) = this .getDefine ( ) .getSuperModule ( _)
465+ )
466+ ) and
469467 name = this .getFile ( ) .getBaseName ( ) .regexpCapture ( "([a-zA-Z0-9]+).[cC]ontroller.js" , 1 )
470468 }
471469
0 commit comments