@abaplint/transpiler 2.4.6 → 2.4.8
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.
|
@@ -20,7 +20,7 @@ class SQLCondTranspiler {
|
|
|
20
20
|
const chain = (_a = c.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
21
21
|
if (chain) {
|
|
22
22
|
const code = new field_chain_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
|
|
23
|
-
ret += `" + (${code}
|
|
23
|
+
ret += `" + abap.expandDynamic(${code}, (name) => {try { return eval(name);} catch {}}) + "`;
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
throw new Error("SQL Condition, transpiler todo, dyn cond, " + c.concatTokens());
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReturnTranspiler = void 0;
|
|
4
|
+
const abaplint = require("@abaplint/core");
|
|
4
5
|
const chunk_1 = require("../chunk");
|
|
5
6
|
const unique_identifier_1 = require("../unique_identifier");
|
|
6
7
|
class ReturnTranspiler {
|
|
@@ -18,6 +19,10 @@ class ReturnTranspiler {
|
|
|
18
19
|
if (traversal.isInsideDoOrWhile(node)) {
|
|
19
20
|
pre = `abap.builtin.sy.get().index.set(${unique_identifier_1.UniqueIdentifier.getIndexBackup1()});\n`;
|
|
20
21
|
}
|
|
22
|
+
if ((scope === null || scope === void 0 ? void 0 : scope.getIdentifier().stype) === abaplint.ScopeType.Method
|
|
23
|
+
&& (scope === null || scope === void 0 ? void 0 : scope.getIdentifier().sname.toLowerCase()) === "constructor") {
|
|
24
|
+
extra = " this";
|
|
25
|
+
}
|
|
21
26
|
return new chunk_1.Chunk().append(pre + "return" + extra + ";", node, traversal);
|
|
22
27
|
}
|
|
23
28
|
}
|