@abaplint/transpiler 2.6.18 → 2.6.20

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.
@@ -60,12 +60,10 @@ class AssignTranspiler {
60
60
  const firstFirst = first.getChildren()[1];
61
61
  if ((firstFirst === null || firstFirst === void 0 ? void 0 : firstFirst.get()) instanceof abaplint.Expressions.Constant) {
62
62
  const s = (_b = firstFirst.getFirstToken().getStr().toLowerCase().match(/\w+/)) === null || _b === void 0 ? void 0 : _b.toString();
63
- if (s === "me") {
64
- options.push(`dynamicSource: this.me`);
65
- }
66
- else {
67
- options.push(`dynamicSource: (() => {try { return ${s}; } catch {}})()`);
68
- }
63
+ options.push(`dynamicSource: (() => {
64
+ try { return ${s}; } catch {}
65
+ try { return this.${s}; } catch {}
66
+ })()`);
69
67
  }
70
68
  else if ((firstFirst === null || firstFirst === void 0 ? void 0 : firstFirst.get()) instanceof abaplint.Expressions.FieldChain && firstFirst instanceof abaplint.Nodes.ExpressionNode) {
71
69
  const code = new expressions_1.FieldChainTranspiler(true).transpile(firstFirst, traversal).getCode();
@@ -77,7 +75,11 @@ class AssignTranspiler {
77
75
  }
78
76
  }
79
77
  else if ((first === null || first === void 0 ? void 0 : first.get()) instanceof abaplint.Expressions.Source && first instanceof abaplint.Nodes.ExpressionNode) {
80
- options.push(`dynamicSource: (() => {try { return ${first.concatTokens()}; } catch {}})()`);
78
+ const name = first.concatTokens().toLowerCase();
79
+ options.push(`dynamicSource: (() => {
80
+ try { return ${name}; } catch {}
81
+ try { return this.${name}; } catch {}
82
+ })()`);
81
83
  }
82
84
  }
83
85
  if (concat.endsWith(" CASTING.") || concat.includes(" CASTING TYPE ")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.6.18",
3
+ "version": "2.6.20",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",