@abaplint/transpiler 2.0.10 → 2.0.11

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.
@@ -5,13 +5,24 @@ const abaplint = require("@abaplint/core");
5
5
  const chunk_1 = require("../chunk");
6
6
  class MoveTranspiler {
7
7
  transpile(node, traversal) {
8
+ var _a;
8
9
  const source = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
9
10
  const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));
10
- const ret = new chunk_1.Chunk()
11
- .appendChunk(target)
12
- .appendString(".set(")
13
- .appendChunk(source)
14
- .append(");", node.getLastToken(), traversal);
11
+ const ret = new chunk_1.Chunk();
12
+ const second = (_a = node.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.concatTokens();
13
+ if (second === "?=") {
14
+ ret.appendString("await abap.statements.cast(")
15
+ .appendChunk(target)
16
+ .appendString(", ")
17
+ .appendChunk(source)
18
+ .append(");", node.getLastToken(), traversal);
19
+ }
20
+ else {
21
+ ret.appendChunk(target)
22
+ .appendString(".set(")
23
+ .appendChunk(source)
24
+ .append(");", node.getLastToken(), traversal);
25
+ }
15
26
  return ret;
16
27
  }
17
28
  }
@@ -60,6 +60,9 @@ class InterfaceTranspiler {
60
60
  const a = val;
61
61
  for (const v of Object.keys(val)) {
62
62
  const s = a[v];
63
+ if (s === undefined) {
64
+ continue;
65
+ }
63
66
  ret += name + ".get()." + v + ".set(" + s + ");\n";
64
67
  }
65
68
  }
@@ -8,11 +8,15 @@ class TranspileTypes {
8
8
  return "let " + t.getName().toLowerCase() + " = " + this.toType(type) + ";";
9
9
  }
10
10
  toType(type) {
11
+ var _a;
11
12
  let resolved = "";
12
13
  let extra = "";
13
14
  if (type instanceof abaplint.BasicTypes.ObjectReferenceType
14
15
  || type instanceof abaplint.BasicTypes.GenericObjectReferenceType) {
15
16
  resolved = "ABAPObject";
17
+ if (type.getQualifiedName() !== undefined) {
18
+ extra = "{qualifiedName: \"" + ((_a = type.getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + "\"}";
19
+ }
16
20
  }
17
21
  else if (type instanceof abaplint.BasicTypes.TableType) {
18
22
  resolved = "Table";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,12 +28,12 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.89.0",
31
+ "@abaplint/core": "^2.89.12",
32
32
  "source-map": "^0.7.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/chai": "^4.3.1",
36
- "@types/mocha": "^9.1.0",
36
+ "@types/mocha": "^9.1.1",
37
37
  "chai": "^4.3.6",
38
38
  "mocha": "^9.2.2",
39
39
  "source-map-support": "^0.5.21",