@abaplint/transpiler 2.6.9 → 2.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/traversal.js +9 -7
- package/package.json +1 -1
package/build/src/traversal.js
CHANGED
|
@@ -308,7 +308,7 @@ class Traversal {
|
|
|
308
308
|
}
|
|
309
309
|
// attributes from directly implemented interfaces(not interfaces implemented in super classes)
|
|
310
310
|
for (const i of def.getImplementing()) {
|
|
311
|
-
ret += this.dataFromInterfaces(i.name, scope);
|
|
311
|
+
ret += this.dataFromInterfaces(i.name, scope, cName);
|
|
312
312
|
}
|
|
313
313
|
// handle aliases after initialization of carrier variables
|
|
314
314
|
for (const a of ((_b = def.getAliases()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
|
|
@@ -343,7 +343,7 @@ class Traversal {
|
|
|
343
343
|
}
|
|
344
344
|
return clas;
|
|
345
345
|
}
|
|
346
|
-
dataFromInterfaces(name, scope) {
|
|
346
|
+
dataFromInterfaces(name, scope, cname) {
|
|
347
347
|
let ret = "";
|
|
348
348
|
const intf = this.findInterfaceDefinition(name, scope);
|
|
349
349
|
for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getConstants()) || []) {
|
|
@@ -357,15 +357,17 @@ class Traversal {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {
|
|
360
|
-
if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
360
|
const n = Traversal.escapeNamespace(name.toLowerCase()) + "$" + a.getName().toLowerCase();
|
|
364
361
|
// note: interface inheritenace and super inheritance might be strange,
|
|
365
|
-
|
|
362
|
+
if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
|
|
363
|
+
ret += "if (this." + n + " === undefined) this." + n + " = " + cname + "." + n + ";\n";
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
ret += "if (this." + n + " === undefined) this." + n + " = " + new transpile_types_1.TranspileTypes().toType(a.getType()) + ";\n";
|
|
367
|
+
}
|
|
366
368
|
}
|
|
367
369
|
for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {
|
|
368
|
-
ret += this.dataFromInterfaces(i.name, scope);
|
|
370
|
+
ret += this.dataFromInterfaces(i.name, scope, cname);
|
|
369
371
|
}
|
|
370
372
|
return ret;
|
|
371
373
|
}
|