@abaplint/runtime 2.7.35 → 2.7.37
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.
package/build/src/types/hex.js
CHANGED
|
@@ -14,10 +14,14 @@ class Hex {
|
|
|
14
14
|
this.value = value;
|
|
15
15
|
}
|
|
16
16
|
else if (typeof value === "number") {
|
|
17
|
+
const maxVal = Math.pow(2, this.length * 8);
|
|
17
18
|
if (value < 0) {
|
|
18
|
-
const maxVal = Math.pow(2, this.length * 8);
|
|
19
19
|
this.value = Math.round(value + maxVal).toString(16);
|
|
20
20
|
}
|
|
21
|
+
else if (value >= maxVal) {
|
|
22
|
+
const sub = value % maxVal;
|
|
23
|
+
this.value = Math.round(sub).toString(16);
|
|
24
|
+
}
|
|
21
25
|
else {
|
|
22
26
|
this.value = Math.round(value).toString(16);
|
|
23
27
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.XString = void 0;
|
|
4
4
|
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
const float_1 = require("./float");
|
|
6
|
+
const character_1 = require("./character");
|
|
6
7
|
class XString {
|
|
7
8
|
constructor(input) {
|
|
8
9
|
this.value = "";
|
|
@@ -29,6 +30,9 @@ class XString {
|
|
|
29
30
|
v = value.getRaw();
|
|
30
31
|
this.set(v);
|
|
31
32
|
}
|
|
33
|
+
else if (value instanceof character_1.Character) {
|
|
34
|
+
this.set(value.getTrimEnd());
|
|
35
|
+
}
|
|
32
36
|
else if (typeof v === "number") {
|
|
33
37
|
this.value = v.toString(16);
|
|
34
38
|
const finalLength = Math.ceil(this.value.length / 2) * 2;
|