@abaplint/runtime 2.5.79 → 2.6.0

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.
@@ -10,6 +10,7 @@ function numofchar(input) {
10
10
  else {
11
11
  str = input.val.get();
12
12
  }
13
+ str = str.trimEnd();
13
14
  return new types_1.Integer().set(str.length);
14
15
  }
15
16
  exports.numofchar = numofchar;
@@ -27,6 +27,16 @@ function eq(left, right) {
27
27
  else if (left instanceof types_1.FieldSymbol) {
28
28
  return eq(left.getPointer(), right);
29
29
  }
30
+ // for performance, do the typicaly/easy cases first
31
+ if (right instanceof types_1.Character && left instanceof types_1.Character && right.getLength() === left.getLength()) {
32
+ return right.get() === left.get();
33
+ }
34
+ else if (right instanceof types_1.Numc && left instanceof types_1.Numc && right.getLength() === left.getLength()) {
35
+ return right.get() === left.get();
36
+ }
37
+ else if (right instanceof types_1.Integer && left instanceof types_1.Integer) {
38
+ return right.get() === left.get();
39
+ }
30
40
  if (left instanceof types_1.Table || right instanceof types_1.Table || left instanceof types_1.HashedTable || right instanceof types_1.HashedTable) {
31
41
  if ((left instanceof types_1.Table || left instanceof types_1.HashedTable)
32
42
  && (right instanceof types_1.Table || right instanceof types_1.HashedTable)) {
@@ -8,7 +8,7 @@ function concatenate(input) {
8
8
  const tab = input.source[0];
9
9
  if (tab instanceof types_1.Table) {
10
10
  for (const l of tab.array()) {
11
- list.push(l.get());
11
+ list.push(l.get().trimEnd());
12
12
  }
13
13
  }
14
14
  }
@@ -39,8 +39,9 @@ function convert(source, target) {
39
39
  else {
40
40
  zone = source.zone.get() + "";
41
41
  }
42
+ zone = zone.trimEnd();
42
43
  }
43
- if (zone === "") {
44
+ if (zone.trim() === "") {
44
45
  zone = "UTC";
45
46
  }
46
47
  ////////////////////////
@@ -48,7 +48,7 @@ class Character {
48
48
  this.value = this.value.substr(0, this.length);
49
49
  }
50
50
  else if (this.value.length < this.length) {
51
- this.value.padEnd(this.length, " ");
51
+ this.value = this.value.padEnd(this.length, " ");
52
52
  }
53
53
  return this;
54
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.5.79",
3
+ "version": "2.6.0",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",