@abaplint/transpiler 2.5.35 → 2.5.37
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.
|
@@ -103,16 +103,22 @@ class ClassImplementationTranspiler {
|
|
|
103
103
|
// but this will probably work
|
|
104
104
|
if (traversal.getCurrentObject().getType() === "CLAS") {
|
|
105
105
|
// gather call of all class constructors together for a global class, also local classes
|
|
106
|
-
// as they might use the global class
|
|
106
|
+
// as they might use the global class, except for local testclass constructors
|
|
107
107
|
if (cdef.isGlobal() === true) {
|
|
108
108
|
for (const f of traversal.getCurrentObject().getABAPFiles()) {
|
|
109
109
|
for (const def of f.getInfo().listClassDefinitions()) {
|
|
110
|
-
if (def.
|
|
110
|
+
if (def.isForTesting === true) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
else if (def.methods.some(m => m.name.toLowerCase() === "class_constructor")) {
|
|
111
114
|
ret += "await " + traversal.lookupClassOrInterface(def.name, node.getFirstToken()) + ".class_constructor();\n";
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
}
|
|
119
|
+
if (cdef.isGlobal() === false && cdef.isForTesting() === true && cdef.getMethodDefinitions().getByName("class_constructor")) {
|
|
120
|
+
ret += "await " + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
|
|
121
|
+
}
|
|
116
122
|
}
|
|
117
123
|
else if (cdef.getMethodDefinitions().getByName("class_constructor")) {
|
|
118
124
|
ret += "await " + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
|