@abaplint/runtime 2.5.25 → 2.5.26

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.
@@ -16,7 +16,14 @@ async function cast(target, source) {
16
16
  }
17
17
  // eslint-disable-next-line prefer-const
18
18
  let checkIntf = true;
19
- if (target instanceof types_1.FieldSymbol && target.getPointer() === undefined) {
19
+ if (source instanceof types_1.FieldSymbol) {
20
+ if (source.getPointer() === undefined) {
21
+ throw new Error("GETWA_NOT_ASSIGNED");
22
+ }
23
+ await cast(target, source.getPointer());
24
+ return;
25
+ }
26
+ else if (target instanceof types_1.FieldSymbol && target.getPointer() === undefined) {
20
27
  throw new Error("GETWA_NOT_ASSIGNED");
21
28
  }
22
29
  let targetName = undefined;
@@ -6,6 +6,7 @@ const throw_error_1 = require("../throw_error");
6
6
  const character_1 = require("./character");
7
7
  const field_symbol_1 = require("./field_symbol");
8
8
  const integer_1 = require("./integer");
9
+ const packed_1 = require("./packed");
9
10
  const structure_1 = require("./structure");
10
11
  class String {
11
12
  constructor(input) {
@@ -35,9 +36,15 @@ class String {
35
36
  else if (value instanceof structure_1.Structure) {
36
37
  this.value = value.getCharacter();
37
38
  }
39
+ else if (value instanceof packed_1.Packed) {
40
+ const lv_sign = value.get() >= 0 ? " " : "-";
41
+ this.value = Math.abs(value.get()).toFixed(value.getDecimals());
42
+ this.value += lv_sign;
43
+ }
38
44
  else if (value instanceof integer_1.Integer) {
39
- const lv_sign = (parseInt(value.get(), 10) >= 0) ? " " : "-";
40
- this.value = Math.abs(parseInt(value.get(), 10)) + lv_sign;
45
+ const lv_sign = value.get() >= 0 ? " " : "-";
46
+ this.value = Math.abs(value.get()) + "";
47
+ this.value += lv_sign;
41
48
  }
42
49
  else {
43
50
  this.value = value.get() + "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.5.25",
3
+ "version": "2.5.26",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",