@abaplint/runtime 2.8.4 → 2.8.6

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.
@@ -17,7 +17,8 @@ function abs(input) {
17
17
  else {
18
18
  num_in = parseFloat(input.val.get().toString());
19
19
  }
20
- return Math.abs(num_in);
20
+ const ret = Math.abs(num_in);
21
+ return ret;
21
22
  }
22
23
  exports.abs = abs;
23
24
  //# sourceMappingURL=abs.js.map
@@ -93,11 +93,20 @@ function shift_byte_mode(target, options) {
93
93
  }
94
94
  }
95
95
  else if (options?.places) {
96
- const p = options.places.get() * 2;
97
96
  if (options.circular) {
98
- value = value.substr(p) + value.substr(0, p);
97
+ if (options.direction === "RIGHT") {
98
+ for (let i = 0; i < options.places.get(); i++) {
99
+ value = value.substr(value.length - 2) + value.substr(0, value.length - 2);
100
+ }
101
+ }
102
+ else {
103
+ for (let i = 0; i < options.places.get(); i++) {
104
+ value = value.substr(2) + value.substr(0, 2);
105
+ }
106
+ }
99
107
  }
100
108
  else {
109
+ const p = options.places.get() * 2;
101
110
  value = value.substr(p);
102
111
  }
103
112
  }
@@ -22,7 +22,11 @@ class Hex {
22
22
  else if (typeof value === "number") {
23
23
  const maxVal = Math.pow(2, this.length * 8);
24
24
  if (value < 0) {
25
- this.value = Math.round(value + maxVal).toString(16);
25
+ let hex = Math.round(value + 0x100000000).toString(16).toUpperCase();
26
+ if (hex.length > this.length * 2) {
27
+ hex = hex.substring(hex.length - this.length * 2);
28
+ }
29
+ this.value = hex;
26
30
  }
27
31
  else if (value >= maxVal) {
28
32
  const sub = value % maxVal;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Packed = void 0;
4
4
  const float_1 = require("./float");
5
5
  const throw_error_1 = require("../throw_error");
6
+ const integer8_1 = require("./integer8");
6
7
  const digits = new RegExp(/^\s*-?\+?\d*\.?\d* *$/i);
7
8
  class Packed {
8
9
  constructor(input) {
@@ -38,6 +39,9 @@ class Packed {
38
39
  }
39
40
  this.value = this.round(parseFloat(value), this.decimals);
40
41
  }
42
+ else if (value instanceof integer8_1.Integer8) {
43
+ this.value = Number(value.get());
44
+ }
41
45
  else if (value instanceof float_1.Float) {
42
46
  this.value = this.round(value.getRaw(), this.decimals);
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.8.4",
3
+ "version": "2.8.6",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",