@abaplint/runtime 2.7.21 → 2.7.23

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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assert = void 0;
4
4
  function assert(input) {
5
5
  if (input === false) {
6
- throw new Error("ASSERT failed");
6
+ throw new Error("ASSERTION_FAILED");
7
7
  }
8
8
  }
9
9
  exports.assert = assert;
@@ -19,6 +19,9 @@ function describe(input) {
19
19
  else if (input.field instanceof types_1.Integer) {
20
20
  input.type.set("I");
21
21
  }
22
+ else if (input.field instanceof types_1.Integer8) {
23
+ input.type.set("8");
24
+ }
22
25
  else if (input.field instanceof types_1.Date) {
23
26
  input.type.set("D");
24
27
  }
@@ -4,6 +4,9 @@ exports.getBit = void 0;
4
4
  function getBit(number, hex, output) {
5
5
  const charIndex = Math.floor((number.get() - 1) / 8);
6
6
  const bitIndex = (number.get() - 1) % 8;
7
+ if (bitIndex < 0) {
8
+ throw new Error("BIT_OFFSET_NOT_POSITIVE");
9
+ }
7
10
  const h = hex.get().substr(charIndex * 2, 2);
8
11
  const parsed = parseInt(h, 16).toString(2);
9
12
  const bits = parsed.padStart(8, "0");
@@ -28,7 +28,7 @@ function insertInternal(options) {
28
28
  }
29
29
  else if (isSorted) {
30
30
  const insert = options.data instanceof types_1.Structure ? options.data.get() : { table_line: options.data };
31
- const compare = (row) => {
31
+ let compare = (row) => {
32
32
  var _a;
33
33
  for (const key of ((_a = tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.primaryKey) === null || _a === void 0 ? void 0 : _a.keyFields) || []) {
34
34
  if (key.includes("-")) {
@@ -56,6 +56,12 @@ function insertInternal(options) {
56
56
  binary = true;
57
57
  }
58
58
  }
59
+ else {
60
+ compare = (row) => {
61
+ // @ts-ignore
62
+ return (0, compare_1.eq)(row.table_line, options.data);
63
+ };
64
+ }
59
65
  (0, read_table_1.readTable)(options.table, { withKey: compare, withKeyValue: withKeyValue, binarySearch: binary });
60
66
  // @ts-ignore
61
67
  if (abap.builtin.sy.get().subrc.get() === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.21",
3
+ "version": "2.7.23",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",