@abaplint/transpiler-cli 2.6.27 → 2.6.28
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/bundle.js +18 -6
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -74371,7 +74371,7 @@ class MethodImplementationTranspiler {
|
|
|
74371
74371
|
if (methodName.toUpperCase() === "CONSTRUCTOR" && classDef) {
|
|
74372
74372
|
// note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name
|
|
74373
74373
|
unique = "INPUT";
|
|
74374
|
-
after = traversal.buildConstructorContents(scope.getParent(), classDef);
|
|
74374
|
+
// after = traversal.buildConstructorContents(scope.getParent(), classDef);
|
|
74375
74375
|
methodName = "constructor_";
|
|
74376
74376
|
}
|
|
74377
74377
|
const methodDef = this.findMethodParameters(scope);
|
|
@@ -76694,10 +76694,13 @@ class ClassImplementationTranspiler {
|
|
|
76694
76694
|
const ret = new chunk_1.Chunk();
|
|
76695
76695
|
for (const c of node.getChildren()) {
|
|
76696
76696
|
ret.appendChunk(traversal.traverse(c));
|
|
76697
|
+
if (c.get() instanceof abaplint.Statements.ClassImplementation) {
|
|
76698
|
+
ret.appendString(this.buildConstructor(node.getFirstStatement(), traversal));
|
|
76699
|
+
}
|
|
76697
76700
|
if (c instanceof abaplint.Nodes.StatementNode
|
|
76698
76701
|
&& c.get() instanceof abaplint.Statements.ClassImplementation
|
|
76699
76702
|
&& this.hasConstructor(node) === false) {
|
|
76700
|
-
ret.appendString(
|
|
76703
|
+
ret.appendString("async constructor_(INPUT) {\nif (super.constructor_) { await super.constructor_(INPUT); }\nreturn this;\n}\n");
|
|
76701
76704
|
}
|
|
76702
76705
|
}
|
|
76703
76706
|
ret.appendString(this.buildStatic(node.findFirstExpression(abaplint.Expressions.ClassName), traversal));
|
|
@@ -76811,6 +76814,9 @@ class ClassImplementationTranspiler {
|
|
|
76811
76814
|
}
|
|
76812
76815
|
buildConstructor(node, traversal) {
|
|
76813
76816
|
var _a;
|
|
76817
|
+
if (node === undefined) {
|
|
76818
|
+
throw new Error("buildConstructor node undefined");
|
|
76819
|
+
}
|
|
76814
76820
|
const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
|
|
76815
76821
|
const token = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
76816
76822
|
if (token === undefined) {
|
|
@@ -76824,7 +76830,8 @@ class ClassImplementationTranspiler {
|
|
|
76824
76830
|
if (ret === "") {
|
|
76825
76831
|
return ret;
|
|
76826
76832
|
}
|
|
76827
|
-
|
|
76833
|
+
// note: for CALL TRANSFORMATION, its nice that the values are initialized by the JS constructor,
|
|
76834
|
+
return "constructor() {\n" + ret + "}\n";
|
|
76828
76835
|
}
|
|
76829
76836
|
}
|
|
76830
76837
|
exports.ClassImplementationTranspiler = ClassImplementationTranspiler;
|
|
@@ -78022,10 +78029,15 @@ class Traversal {
|
|
|
78022
78029
|
buildConstructorContents(scope, def) {
|
|
78023
78030
|
var _a, _b, _c;
|
|
78024
78031
|
let ret = "";
|
|
78025
|
-
if (def.getSuperClass() !== undefined
|
|
78026
|
-
|
|
78027
|
-
ret += `await super.constructor_(INPUT);\n`;
|
|
78032
|
+
if (def.getSuperClass() !== undefined || def.getName().toUpperCase() === "CX_ROOT") {
|
|
78033
|
+
ret += "super();\n";
|
|
78028
78034
|
}
|
|
78035
|
+
/*
|
|
78036
|
+
if (def.getSuperClass() !== undefined
|
|
78037
|
+
&& def.getMethodDefinitions().getByName("CONSTRUCTOR") === undefined) {
|
|
78038
|
+
ret += `await super.constructor_(INPUT);\n`;
|
|
78039
|
+
}
|
|
78040
|
+
*/
|
|
78029
78041
|
const cName = Traversal.escapeNamespace(def.getName().toLowerCase());
|
|
78030
78042
|
ret += "this.me = new abap.types.ABAPObject();\n";
|
|
78031
78043
|
ret += "this.me.set(this);\n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.28",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.6.
|
|
28
|
+
"@abaplint/transpiler": "^2.6.28",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|