@abaplint/runtime 2.4.18 → 2.4.20

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.
@@ -9,10 +9,14 @@ function compareIn(left, right) {
9
9
  }
10
10
  for (const row of right.array()) {
11
11
  if ((0, eq_1.eq)(row.get()["sign"], "I") && (0, eq_1.eq)(row.get()["option"], "EQ")) {
12
- return (0, eq_1.eq)(row.get()["low"], left);
12
+ if ((0, eq_1.eq)(row.get()["low"], left)) {
13
+ return true;
14
+ }
13
15
  }
14
16
  else if ((0, eq_1.eq)(row.get()["sign"], "I") && (0, eq_1.eq)(row.get()["option"], "CP")) {
15
- return (0, cp_1.cp)(left, row.get()["low"]);
17
+ if ((0, cp_1.cp)(left, row.get()["low"])) {
18
+ return true;
19
+ }
16
20
  }
17
21
  else {
18
22
  console.dir(row);
@@ -53,8 +53,11 @@ function loop(table, options) {
53
53
  throw new Error("LOOP at undefined");
54
54
  }
55
55
  else if (table instanceof types_1.FieldSymbol) {
56
- // @ts-ignore
57
- yield __await(yield* __asyncDelegator(__asyncValues(loop(table.getPointer(), options))));
56
+ const pnt = table.getPointer();
57
+ if (pnt === undefined) {
58
+ throw "GETWA_NOT_ASSIGNED";
59
+ }
60
+ yield __await(yield* __asyncDelegator(__asyncValues(loop(pnt, options))));
58
61
  return yield __await(void 0);
59
62
  }
60
63
  const length = table.array().length;
@@ -1,4 +1,4 @@
1
- import { Table } from "../types";
1
+ import { FieldSymbol, Table } from "../types";
2
2
  export interface ISortOptions {
3
3
  descending?: boolean;
4
4
  by?: {
@@ -6,4 +6,4 @@ export interface ISortOptions {
6
6
  descending?: boolean;
7
7
  }[];
8
8
  }
9
- export declare function sort(input: Table, options?: ISortOptions): void;
9
+ export declare function sort(input: Table | FieldSymbol, options?: ISortOptions): void;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sort = void 0;
4
+ const types_1 = require("../types");
4
5
  const compare_1 = require("../compare");
5
6
  function compare(a, b, input) {
6
7
  const componentName = input.component;
@@ -26,6 +27,14 @@ function compare(a, b, input) {
26
27
  }
27
28
  function sort(input, options) {
28
29
  // console.dir(options);
30
+ if (input instanceof types_1.FieldSymbol) {
31
+ const pnt = input.getPointer();
32
+ if (pnt === undefined) {
33
+ throw "GETWA_NOT_ASSIGNED";
34
+ }
35
+ sort(pnt, options);
36
+ return;
37
+ }
29
38
  if (options === null || options === void 0 ? void 0 : options.by) {
30
39
  if (options.by.length === 0) {
31
40
  throw "SortByLengthZero";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.4.18",
3
+ "version": "2.4.20",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -36,6 +36,6 @@
36
36
  "typescript": "^4.8.4"
37
37
  },
38
38
  "dependencies": {
39
- "temporal-polyfill": "^0.1.0"
39
+ "temporal-polyfill": "^0.1.1"
40
40
  }
41
41
  }