@abaplint/runtime 2.8.1 → 2.8.2
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
|
@@ -34,7 +34,18 @@ class Hex {
|
|
|
34
34
|
this.value = this.value.padStart(this.length * 2, "0");
|
|
35
35
|
}
|
|
36
36
|
else if (value instanceof integer8_1.Integer8) {
|
|
37
|
-
|
|
37
|
+
let hex = "";
|
|
38
|
+
if (value.get() < 0) {
|
|
39
|
+
hex = (value.get() + 0x10000000000000000n).toString(16).toUpperCase();
|
|
40
|
+
if (hex.length > this.length * 2) {
|
|
41
|
+
hex = hex.substring(hex.length - this.length * 2);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
hex = value.get().toString(16).toUpperCase();
|
|
46
|
+
hex = hex.padStart(this.length * 2, "0");
|
|
47
|
+
}
|
|
48
|
+
this.set(hex);
|
|
38
49
|
}
|
|
39
50
|
else {
|
|
40
51
|
let v = value.get();
|
|
@@ -37,6 +37,7 @@ class Integer8 {
|
|
|
37
37
|
this.set(Math.round(value.getRaw()));
|
|
38
38
|
}
|
|
39
39
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString) {
|
|
40
|
+
// todo, can BigInt("0x" + value.get()); be used?
|
|
40
41
|
let num = parseInt(value.get(), 16);
|
|
41
42
|
// handle two complement,
|
|
42
43
|
if (value instanceof hex_1.Hex && value.getLength() >= 4) {
|