@abaplint/transpiler 2.12.6 → 2.12.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.
@@ -109,6 +109,15 @@ class MethodSourceTranspiler {
109
109
  }
110
110
  call += traversal.traverse(child).getCode();
111
111
  }
112
+ else if (child.get() instanceof core_1.Expressions.SourceFieldSymbol) {
113
+ call += traversal.traverse(child).getCode();
114
+ }
115
+ else if (child.get() instanceof core_1.Expressions.ComponentName) {
116
+ call += `["${child.concatTokens().toLowerCase()}"]`;
117
+ }
118
+ else if (child.get() instanceof core_1.Tokens.Dash) {
119
+ call += '.get()';
120
+ }
112
121
  else {
113
122
  ret.appendString("MethodSourceTranspiler-" + child.get().constructor.name + "-todo");
114
123
  }
@@ -28,7 +28,11 @@ class PerformTranspiler {
28
28
  const name = t.getFirstToken().getStr();
29
29
  params.push(`"${name}": ` + traversal.traverse(t).getCode());
30
30
  }
31
- return new chunk_1.Chunk("await " + ref + `({${params.join(",")}});`);
31
+ let call = "await " + ref + `({${params.join(",")}});`;
32
+ if (node.concatTokens().toUpperCase().includes(" IF FOUND")) {
33
+ call = `if (${ref} !== undefined) { ${call} }`;
34
+ }
35
+ return new chunk_1.Chunk(call);
32
36
  }
33
37
  else {
34
38
  // todo: most of this needs rewriting?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.12.6",
3
+ "version": "2.12.8",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",