@abaplint/transpiler 2.10.33 → 2.10.35
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.
|
@@ -45,7 +45,7 @@ class MethodSourceTranspiler {
|
|
|
45
45
|
}
|
|
46
46
|
else if (child.get() instanceof core_1.Expressions.Dynamic) {
|
|
47
47
|
const second = child.getChildren()[1];
|
|
48
|
-
const lookupException = traversal.lookupClassOrInterface("'CX_SY_DYN_CALL_ILLEGAL_METHOD'", child.getFirstToken(), true);
|
|
48
|
+
// const lookupException = traversal.lookupClassOrInterface("'CX_SY_DYN_CALL_ILLEGAL_METHOD'", child.getFirstToken(), true);
|
|
49
49
|
if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {
|
|
50
50
|
if (call.endsWith(".")) {
|
|
51
51
|
call = call.substring(0, call.length - 1);
|
|
@@ -56,19 +56,22 @@ class MethodSourceTranspiler {
|
|
|
56
56
|
call = `abap.dynamicCallLookup(${call}, ${traversal.traverse(second).getCode()})`;
|
|
57
57
|
}
|
|
58
58
|
else if (second.get() instanceof core_1.Expressions.Constant) {
|
|
59
|
-
if (call
|
|
60
|
-
call =
|
|
59
|
+
if (call.endsWith(".")) {
|
|
60
|
+
call = call.substring(0, call.length - 1);
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
call
|
|
62
|
+
if (call === "") {
|
|
63
|
+
call = "this";
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
const methodName = second.getFirstToken().getStr().replace(/[\'\`]/g, "").toLowerCase().replace("~", "$").trimEnd();
|
|
66
|
+
call = `abap.dynamicCallLookup(${call}, "${methodName}")`;
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
69
|
ret.appendString("MethodSourceTranspiler-Unexpected");
|
|
69
70
|
}
|
|
71
|
+
/*
|
|
70
72
|
ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; }\n`);
|
|
71
73
|
ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\n`);
|
|
74
|
+
*/
|
|
72
75
|
}
|
|
73
76
|
else if (child.get() instanceof core_1.Expressions.MethodName
|
|
74
77
|
|| child.get() instanceof core_1.Expressions.AttributeName) {
|
|
@@ -23,7 +23,6 @@ static INTERNAL_TYPE = 'CLAS';
|
|
|
23
23
|
static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
|
|
24
24
|
static IMPLEMENTED_INTERFACES = [${this.findImplementedByClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
|
|
25
25
|
static ATTRIBUTES = {${traversal.buildAttributes(def, scope).join(",\n")}};
|
|
26
|
-
static FRIENDS_ACCESS_STATIC = {}; // todo
|
|
27
26
|
static METHODS = {${traversal.buildMethods(def, scope).join(",\n")}};`, node, traversal);
|
|
28
27
|
}
|
|
29
28
|
findImplementedInterface(traversal, def, scope) {
|
|
@@ -25,7 +25,6 @@ class ${className?.toLowerCase()} {
|
|
|
25
25
|
static IMPLEMENTED_INTERFACES = [];
|
|
26
26
|
static INTERNAL_NAME = 'ABSTRACT_CLASS_INTERNAL_NAME';
|
|
27
27
|
static ATTRIBUTES = {};
|
|
28
|
-
static FRIENDS_ACCESS_STATIC = {};
|
|
29
28
|
async constructor_() {
|
|
30
29
|
this.me = new abap.types.ABAPObject();
|
|
31
30
|
this.me.set(this);
|