@abaplint/transpiler-cli 2.11.30 → 2.11.31
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 +28 -18
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -79530,33 +79530,43 @@ const method_call_param_1 = __webpack_require__(/*! ./method_call_param */ "./no
|
|
|
79530
79530
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79531
79531
|
class MethodCallTranspiler {
|
|
79532
79532
|
transpile(node, traversal) {
|
|
79533
|
+
let post = "";
|
|
79533
79534
|
const nameToken = node.findDirectExpression(core_1.Expressions.MethodName)?.getFirstToken();
|
|
79534
79535
|
if (nameToken === undefined) {
|
|
79535
79536
|
throw new Error("MethodCallTranspiler, name not found");
|
|
79536
79537
|
}
|
|
79538
|
+
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
79539
|
+
const m = traversal.findMethodReference(nameToken, scope);
|
|
79537
79540
|
let name = nameToken.getStr().toLowerCase();
|
|
79538
79541
|
if (traversal.isBuiltinMethod(nameToken)) {
|
|
79539
|
-
|
|
79542
|
+
// todo: this is not correct, the method name might be shadowed
|
|
79543
|
+
name = "abap.builtin." + name + "(";
|
|
79544
|
+
if (name === "abap.builtin.line_exists(" || name === "abap.builtin.line_index(") {
|
|
79545
|
+
name += "() => {";
|
|
79546
|
+
post = "}";
|
|
79547
|
+
}
|
|
79540
79548
|
}
|
|
79541
|
-
|
|
79542
|
-
// it might be aliased?
|
|
79543
|
-
const m = traversal.findMethodReference(nameToken, scope);
|
|
79544
|
-
if (m?.name && traversal.isBuiltinMethod(nameToken) === false) {
|
|
79549
|
+
else if (m?.name) {
|
|
79545
79550
|
name = m.name.toLowerCase();
|
|
79546
|
-
|
|
79547
|
-
|
|
79548
|
-
|
|
79549
|
-
|
|
79550
|
-
|
|
79551
|
-
|
|
79552
|
-
|
|
79553
|
-
|
|
79554
|
-
|
|
79555
|
-
|
|
79556
|
-
|
|
79551
|
+
name = traversal_1.Traversal.escapeNamespace(name.replace("~", "$"));
|
|
79552
|
+
if (m?.def.getVisibility() === core_1.Visibility.Private
|
|
79553
|
+
&& m.def.isStatic() === false) {
|
|
79554
|
+
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
79555
|
+
if (id?.stype === core_1.ScopeType.ClassImplementation
|
|
79556
|
+
&& m.def.getClassName().toUpperCase() === id.sname.toUpperCase()) {
|
|
79557
|
+
name = "#" + name;
|
|
79558
|
+
}
|
|
79559
|
+
else {
|
|
79560
|
+
name = `FRIENDS_ACCESS_INSTANCE["${name}"]`;
|
|
79561
|
+
}
|
|
79557
79562
|
}
|
|
79563
|
+
name = name + "(";
|
|
79564
|
+
}
|
|
79565
|
+
else {
|
|
79566
|
+
// todo: this should never happen?
|
|
79567
|
+
name = traversal_1.Traversal.escapeNamespace(name.replace("~", "$"));
|
|
79568
|
+
name = name + "(";
|
|
79558
79569
|
}
|
|
79559
|
-
name = name + "(";
|
|
79560
79570
|
const step = node.findDirectExpression(core_1.Expressions.MethodCallParam);
|
|
79561
79571
|
if (step === undefined) {
|
|
79562
79572
|
throw new Error("MethodCallTranspiler, unexpected node");
|
|
@@ -79564,7 +79574,7 @@ class MethodCallTranspiler {
|
|
|
79564
79574
|
const ret = new chunk_1.Chunk();
|
|
79565
79575
|
ret.append(name, nameToken, traversal);
|
|
79566
79576
|
ret.appendChunk(new method_call_param_1.MethodCallParamTranspiler(m?.def).transpile(step, traversal));
|
|
79567
|
-
ret.appendString(")");
|
|
79577
|
+
ret.appendString(post + ")");
|
|
79568
79578
|
return ret;
|
|
79569
79579
|
}
|
|
79570
79580
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.31",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@abaplint/core": "^2.113.174",
|
|
31
|
-
"@abaplint/transpiler": "^2.11.
|
|
31
|
+
"@abaplint/transpiler": "^2.11.31",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.2.1",
|
|
34
34
|
"@types/progress": "^2.0.7",
|