@@ -301,21 +301,25 @@ class CustomControl extends SapExtendCall {
301301
302302class ControlPlaceAtCall extends MethodCallNode {
303303 ControlPlaceAtCall ( ) {
304- exists ( SapElement ui5Control |
305- /* 1. `this.placeAt(...)` in a custom control definition */
306- this = ui5Control .asDefinition ( ) .getAThisNode ( ) .getAMemberCall ( "placeAt" )
307- or
308- /*
309- * 2. `new SomeControl(...).placeAt(...)` where
310- * `SomeControl` may be UI5 library control or a custom control
311- */
304+ /* 1. `this.placeAt(...)` in a custom control definition. */
305+ exists ( CustomControl control | this = control .getAThisNode ( ) .getAMemberCall ( "placeAt" ) )
306+ or
307+ /*
308+ * 2. `new SomeControl(...).placeAt(...)` where `SomeControl` may be UI5
309+ * library control or a custom control.
310+ */
312311
313- this = ui5Control .asInstantiation ( ) .getAMemberCall ( "placeAt" )
314- or
315- // this = ui5Control.getParentElement*().asInstantiation().getAMemberCall("placeAt") or
316- /* 3. `.byId(...).placeAt(...)` */
317- this = ui5Control .asReference ( ) .getAMemberCall ( "placeAt" )
312+ exists ( ElementInstantiation controlInstantiation |
313+ this = controlInstantiation .getAMemberCall ( "placeAt" )
318314 )
315+ or
316+ /*
317+ * 3. `oController.getView().byId(...).placeAt(...)` where
318+ * `oController.getView().byId(...)` is a reference to a library control
319+ * or a custom control.
320+ */
321+
322+ exists ( ControlReference controlReference | this = controlReference .getAMemberCall ( "placeAt" ) )
319323 }
320324
321325 string getDomElementId ( ) { result = this .getArgument ( 0 ) .getStringValue ( ) }
@@ -1278,66 +1282,6 @@ private newtype TSapElement =
12781282 TReferenceOfElement ( Reference reference ) or
12791283 TInstantiationOfElement ( ElementInstantiation newNode )
12801284
1281- class SapElement extends TSapElement {
1282- SapExtendCall asDefinition ( ) { this = TDefinitionOfElement ( result ) }
1283-
1284- Reference asReference ( ) { this = TReferenceOfElement ( result ) }
1285-
1286- ElementInstantiation asInstantiation ( ) { this = TInstantiationOfElement ( result ) }
1287-
1288- SapElement getParentElement ( ) {
1289- result .asReference ( ) = this .asDefinition ( ) .( CustomControl ) .getController ( ) .getAViewReference ( ) or
1290- result .asReference ( ) =
1291- this .asReference ( ) .( ControlReference ) .getDefinition ( ) .getController ( ) .getAViewReference ( ) or
1292- result .asDefinition ( ) = this .asReference ( ) .( ViewReference ) .getDefinition ( ) .getController ( ) or
1293- result .asDefinition ( ) = this .asDefinition ( ) .( CustomController ) .getOwnerComponent ( ) or
1294- result .asDefinition ( ) =
1295- this .asReference ( ) .( ControllerReference ) .getDefinition ( ) .getOwnerComponent ( ) or
1296- /* ==================== exists(result.asInstantiation()) branches ==================== */
1297- result .asInstantiation ( ) =
1298- this .asReference ( ) .( ControlReference ) .getAMemberCall ( _) .getAnArgument ( ) .getALocalSource ( ) or
1299- result .asInstantiation ( ) =
1300- this .asReference ( ) .( ControlReference ) .getAPropertyWrite ( ) .getRhs ( ) .getALocalSource ( )
1301- // or
1302- // result.asInstantiation() =
1303- // this.asInstantiation().getAMemberCall(_).getAnArgument().getALocalSource() or
1304- // result.asInstantiation() = this.asInstantiation().getAPropertyWrite().getRhs().getALocalSource() or
1305- // result.asInstantiation() = this.asInstantiation().getAnArgument()
1306- // TrackParentControlConfig::flow(this.asInstantiation())
1307- /* =================================================================================== */
1308- }
1309-
1310- string getId ( ) {
1311- result = this .asInstantiation ( ) .getId ( )
1312- or
1313- /* TODO: Needs testing */
1314- result =
1315- this .asDefinition ( )
1316- .( CustomControl )
1317- .getMetadata ( )
1318- .getProperty ( "id" )
1319- .getAPropertySource ( )
1320- .getStringValue ( )
1321- /*
1322- * Note that because we cannot statically determine the ID of an element from the references alone,
1323- * we do not implement the branch of `TReferenceOfElement`.
1324- */
1325-
1326- }
1327-
1328- string toString ( ) {
1329- result = this .asDefinition ( ) .toString ( ) or
1330- result = this .asReference ( ) .toString ( ) or
1331- result = this .asInstantiation ( ) .toString ( )
1332- }
1333-
1334- Location getLocation ( ) {
1335- result = this .asDefinition ( ) .getLocation ( ) or
1336- result = this .asReference ( ) .getLocation ( ) or
1337- result = this .asInstantiation ( ) .getLocation ( )
1338- }
1339- }
1340-
13411285/**
13421286 * The property metadata found in an SapExtendCall.
13431287 */
0 commit comments