@abaplint/transpiler 1.7.33 → 1.7.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/src/statements/call.js +11 -3
- package/package.json +2 -2
|
@@ -6,16 +6,24 @@ const chunk_1 = require("../chunk");
|
|
|
6
6
|
const expressions_1 = require("../expressions");
|
|
7
7
|
class CallTranspiler {
|
|
8
8
|
transpile(node, traversal) {
|
|
9
|
-
var _a;
|
|
9
|
+
var _a, _b, _c;
|
|
10
10
|
if (node.concatTokens().toLowerCase().includes("super->constructor")) {
|
|
11
11
|
// todo, https://github.com/abaplint/transpiler/issues/133
|
|
12
12
|
return new chunk_1.Chunk("");
|
|
13
13
|
}
|
|
14
14
|
const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);
|
|
15
15
|
if (chain) {
|
|
16
|
+
let pre = "";
|
|
17
|
+
let post = "";
|
|
18
|
+
const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);
|
|
19
|
+
if (receiving) {
|
|
20
|
+
pre = traversal.traverse(receiving).getCode() + ".set(";
|
|
21
|
+
post = ")";
|
|
22
|
+
}
|
|
16
23
|
return new chunk_1.Chunk()
|
|
24
|
+
.appendString(pre)
|
|
17
25
|
.appendChunk(traversal.traverse(chain))
|
|
18
|
-
.append(";", node.getLastToken(), traversal);
|
|
26
|
+
.append(post + ";", node.getLastToken(), traversal);
|
|
19
27
|
}
|
|
20
28
|
const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);
|
|
21
29
|
if (methodSource) {
|
|
@@ -26,7 +34,7 @@ class CallTranspiler {
|
|
|
26
34
|
}
|
|
27
35
|
let pre = "";
|
|
28
36
|
let post = "";
|
|
29
|
-
const receiving = (
|
|
37
|
+
const receiving = (_c = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _c === void 0 ? void 0 : _c.findExpressionAfterToken("RECEIVING");
|
|
30
38
|
if (receiving) {
|
|
31
39
|
const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));
|
|
32
40
|
pre = target.getCode() + ".set(";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.34",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abaplint/core": "^2.84.
|
|
30
|
+
"@abaplint/core": "^2.84.9",
|
|
31
31
|
"source-map": "^0.7.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|