@abaplint/runtime 2.7.153 → 2.7.155

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.
@@ -114,6 +114,21 @@ function eq(left, right) {
114
114
  return right.get() === left.get();
115
115
  }
116
116
  }
117
+ else if (right instanceof types_1.Integer8) {
118
+ if (left instanceof types_1.Integer
119
+ || left instanceof types_1.Integer8
120
+ || left instanceof types_1.Packed) {
121
+ return right.get() === left.get();
122
+ }
123
+ }
124
+ else if (right instanceof types_1.Float) {
125
+ if (left instanceof types_1.Float) {
126
+ return right.getRaw() === left.getRaw();
127
+ }
128
+ else if (left instanceof types_1.Integer) {
129
+ return right.getRaw() === left.get();
130
+ }
131
+ }
117
132
  if (left instanceof types_1.Structure || right instanceof types_1.Structure) {
118
133
  if (!(right instanceof types_1.Structure)) {
119
134
  return eq(left.getCharacter(), right);
@@ -6,11 +6,15 @@ const _parse_1 = require("./_parse");
6
6
  function mod(left, right) {
7
7
  const l = (0, _parse_1.parse)(left);
8
8
  const r = (0, _parse_1.parse)(right);
9
+ let val = ((l % r) + r) % r;
10
+ if (val < 0) {
11
+ val = val * -1;
12
+ }
9
13
  if (left instanceof types_1.Integer8 || right instanceof types_1.Integer8) {
10
- return new types_1.Integer8().set(((l % r) + r) % r);
14
+ return new types_1.Integer8().set(val);
11
15
  }
12
16
  else {
13
- return new types_1.Integer().set(((l % r) + r) % r);
17
+ return new types_1.Integer().set(val);
14
18
  }
15
19
  }
16
20
  exports.mod = mod;
@@ -22,6 +22,12 @@ class Time {
22
22
  }
23
23
  else if (typeof value === "string") {
24
24
  this.value = value;
25
+ if (this.value.length > 6) {
26
+ this.value = this.value.substring(0, 6);
27
+ }
28
+ }
29
+ else if (value instanceof string_1.String) {
30
+ this.set(value.get().padEnd(6, "0"));
25
31
  }
26
32
  else if (value instanceof _1.Float) {
27
33
  this.set(Math.round(value.getRaw()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.153",
3
+ "version": "2.7.155",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",