@abaplint/transpiler-cli 2.10.32 → 2.10.34
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 -13
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -78593,7 +78593,7 @@ class MethodSourceTranspiler {
|
|
|
78593
78593
|
}
|
|
78594
78594
|
else if (child.get() instanceof core_1.Expressions.Dynamic) {
|
|
78595
78595
|
const second = child.getChildren()[1];
|
|
78596
|
-
const lookupException = traversal.lookupClassOrInterface("'CX_SY_DYN_CALL_ILLEGAL_METHOD'", child.getFirstToken(), true);
|
|
78596
|
+
// const lookupException = traversal.lookupClassOrInterface("'CX_SY_DYN_CALL_ILLEGAL_METHOD'", child.getFirstToken(), true);
|
|
78597
78597
|
if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {
|
|
78598
78598
|
if (call.endsWith(".")) {
|
|
78599
78599
|
call = call.substring(0, call.length - 1);
|
|
@@ -78604,19 +78604,22 @@ class MethodSourceTranspiler {
|
|
|
78604
78604
|
call = `abap.dynamicCallLookup(${call}, ${traversal.traverse(second).getCode()})`;
|
|
78605
78605
|
}
|
|
78606
78606
|
else if (second.get() instanceof core_1.Expressions.Constant) {
|
|
78607
|
-
if (call
|
|
78608
|
-
call =
|
|
78607
|
+
if (call.endsWith(".")) {
|
|
78608
|
+
call = call.substring(0, call.length - 1);
|
|
78609
78609
|
}
|
|
78610
|
-
|
|
78611
|
-
call
|
|
78610
|
+
if (call === "") {
|
|
78611
|
+
call = "this";
|
|
78612
78612
|
}
|
|
78613
|
-
|
|
78613
|
+
const methodName = second.getFirstToken().getStr().replace(/[\'\`]/g, "").toLowerCase().replace("~", "$").trimEnd();
|
|
78614
|
+
call = `abap.dynamicCallLookup(${call}, "${methodName}")`;
|
|
78614
78615
|
}
|
|
78615
78616
|
else {
|
|
78616
78617
|
ret.appendString("MethodSourceTranspiler-Unexpected");
|
|
78617
78618
|
}
|
|
78619
|
+
/*
|
|
78618
78620
|
ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; }\n`);
|
|
78619
78621
|
ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\n`);
|
|
78622
|
+
*/
|
|
78620
78623
|
}
|
|
78621
78624
|
else if (child.get() instanceof core_1.Expressions.MethodName
|
|
78622
78625
|
|| child.get() instanceof core_1.Expressions.AttributeName) {
|
|
@@ -81795,7 +81798,6 @@ static INTERNAL_TYPE = 'CLAS';
|
|
|
81795
81798
|
static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
|
|
81796
81799
|
static IMPLEMENTED_INTERFACES = [${this.findImplementedByClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
|
|
81797
81800
|
static ATTRIBUTES = {${traversal.buildAttributes(def, scope).join(",\n")}};
|
|
81798
|
-
static FRIENDS_ACCESS_STATIC = {}; // todo
|
|
81799
81801
|
static METHODS = {${traversal.buildMethods(def, scope).join(",\n")}};`, node, traversal);
|
|
81800
81802
|
}
|
|
81801
81803
|
findImplementedInterface(traversal, def, scope) {
|
|
@@ -87001,7 +87003,6 @@ class ${className?.toLowerCase()} {
|
|
|
87001
87003
|
static IMPLEMENTED_INTERFACES = [];
|
|
87002
87004
|
static INTERNAL_NAME = 'ABSTRACT_CLASS_INTERNAL_NAME';
|
|
87003
87005
|
static ATTRIBUTES = {};
|
|
87004
|
-
static FRIENDS_ACCESS_STATIC = {};
|
|
87005
87006
|
async constructor_() {
|
|
87006
87007
|
this.me = new abap.types.ABAPObject();
|
|
87007
87008
|
this.me.set(this);
|
|
@@ -89096,16 +89097,20 @@ async function run() {
|
|
|
89096
89097
|
ret += ` meth.skip();\n`;
|
|
89097
89098
|
continue;
|
|
89098
89099
|
}
|
|
89100
|
+
const callSpecial = (name) => {
|
|
89101
|
+
let ret = "";
|
|
89102
|
+
ret += ` if (test.${name}) await test.${name}();\n`;
|
|
89103
|
+
ret += ` if (test.FRIENDS_ACCESS_INSTANCE.${name}) await test.FRIENDS_ACCESS_INSTANCE.${name}();\n`;
|
|
89104
|
+
ret += ` if (test.FRIENDS_ACCESS_INSTANCE.SUPER && test.FRIENDS_ACCESS_INSTANCE.SUPER.${name}) await test.FRIENDS_ACCESS_INSTANCE.SUPER.${name}();\n`;
|
|
89105
|
+
return ret;
|
|
89106
|
+
};
|
|
89099
89107
|
ret += ` {\n const test = await (new ${lc}()).constructor_();\n`;
|
|
89100
|
-
|
|
89101
|
-
ret += ` if (test.setup) await test.setup();\n`;
|
|
89102
|
-
ret += ` if (test.FRIENDS_ACCESS_INSTANCE.setup) await test.FRIENDS_ACCESS_INSTANCE.setup();\n`;
|
|
89103
|
-
ret += ` if (test.FRIENDS_ACCESS_INSTANCE.SUPER && test.FRIENDS_ACCESS_INSTANCE.SUPER.setup) await test.FRIENDS_ACCESS_INSTANCE.SUPER.setup();\n`;
|
|
89108
|
+
ret += callSpecial("setup");
|
|
89104
89109
|
ret += ` console.log("${st.obj.getName()}: running ${lc}->${m}");\n`;
|
|
89105
89110
|
ret += ` meth = locl.addMethod("${m}");\n`;
|
|
89106
89111
|
ret += ` await test.FRIENDS_ACCESS_INSTANCE.${m}();\n`;
|
|
89107
89112
|
ret += ` meth.pass();\n`;
|
|
89108
|
-
ret +=
|
|
89113
|
+
ret += callSpecial("teardown");
|
|
89109
89114
|
ret += ` }\n`;
|
|
89110
89115
|
}
|
|
89111
89116
|
ret += ` if (${lc}.class_teardown) await ${lc}.class_teardown();\n`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.34",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@abaplint/core": "^2.113.108",
|
|
31
|
-
"@abaplint/transpiler": "^2.10.
|
|
31
|
+
"@abaplint/transpiler": "^2.10.34",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
|
-
"@types/node": "^22.13.
|
|
33
|
+
"@types/node": "^22.13.17",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "=7.2.0",
|
|
36
36
|
"progress": "^2.0.3",
|