@abaplint/runtime 2.5.60 → 2.5.62

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,7 +9,7 @@ function lines(input) {
9
9
  }
10
10
  return lines({ val: input.val.getPointer() });
11
11
  }
12
- return new types_1.Integer().set(input.val.getLength());
12
+ return new types_1.Integer().set(input.val.getArrayLength());
13
13
  }
14
14
  exports.lines = lines;
15
15
  //# sourceMappingURL=lines.js.map
@@ -1,4 +1,4 @@
1
- import { ABAPObject, Structure, Table } from "../types";
1
+ import { ABAPObject, HashedTable, Structure, Table } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function gt(left: number | string | ICharacter | INumeric | ABAPObject | Structure | Table, right: number | string | ICharacter | INumeric | ABAPObject | Structure | Table): boolean;
4
+ export declare function gt(left: number | string | ICharacter | INumeric | ABAPObject | Structure | Table | HashedTable, right: number | string | ICharacter | INumeric | ABAPObject | Structure | Table | HashedTable): boolean;
@@ -16,7 +16,7 @@ function gt(left, right) {
16
16
  }
17
17
  return gt(left, right.getPointer());
18
18
  }
19
- if (left instanceof types_1.Table || right instanceof types_1.Table) {
19
+ if (left instanceof types_1.Table || right instanceof types_1.Table || left instanceof types_1.HashedTable || right instanceof types_1.HashedTable) {
20
20
  throw new Error("runtime_todo, gt TABLE");
21
21
  }
22
22
  if (left instanceof types_1.Hex || right instanceof types_1.Hex) {
@@ -48,6 +48,9 @@ async function deleteInternal(target, options) {
48
48
  return;
49
49
  }
50
50
  if ((options === null || options === void 0 ? void 0 : options.adjacent) === true) {
51
+ if (target instanceof types_1.HashedTable) {
52
+ throw new Error("delete adjacent, hashed table");
53
+ }
51
54
  const array = target.array();
52
55
  for (let index = array.length - 1; index > 0; index--) {
53
56
  const prev = array[index - 1];
@@ -60,7 +60,7 @@ function loop(table, options) {
60
60
  yield __await(yield* __asyncDelegator(__asyncValues(loop(pnt, options))));
61
61
  return yield __await(void 0);
62
62
  }
63
- const length = table.getLength();
63
+ const length = table.getArrayLength();
64
64
  if (length === 0) {
65
65
  // @ts-ignore
66
66
  abap.builtin.sy.get().subrc.set(4);
@@ -1,8 +1,8 @@
1
1
  import { Context } from "../context";
2
2
  import { SelectDatabaseOptions, SelectRuntimeOptions } from "../db/db";
3
- import { FieldSymbol, Structure, Table } from "../types";
3
+ import { FieldSymbol, HashedTable, Structure, Table } from "../types";
4
4
  export declare class SelectDatabase {
5
5
  private readonly context;
6
6
  constructor(context: Context);
7
- select(target: Structure | Table | FieldSymbol, input: SelectDatabaseOptions, runtimeOptions?: SelectRuntimeOptions): Promise<void>;
7
+ select(target: Structure | Table | HashedTable | FieldSymbol, input: SelectDatabaseOptions, runtimeOptions?: SelectRuntimeOptions): Promise<void>;
8
8
  }
@@ -36,7 +36,7 @@ class SelectDatabase {
36
36
  // @ts-ignore
37
37
  abap.statements.moveCorresponding(new types_1.Structure(result), target);
38
38
  }
39
- else if (target instanceof types_1.Table) {
39
+ else if (target instanceof types_1.Table || target instanceof types_1.HashedTable) {
40
40
  for (const row of rows) {
41
41
  const targetRow = (0, clone_1.clone)(target.getRowType());
42
42
  if (targetRow instanceof types_1.Structure) {
@@ -10,7 +10,7 @@ function templateFormatting(source, options) {
10
10
  }
11
11
  return templateFormatting(source.getPointer(), options);
12
12
  }
13
- else if (source instanceof types_1.Table) {
13
+ else if (source instanceof types_1.Table || source instanceof types_1.HashedTable) {
14
14
  throw new Error("STRG_ILLEGAL_DATA_TYPE");
15
15
  }
16
16
  else if (source instanceof types_1.Character) {
@@ -19,6 +19,7 @@ export declare class DataReference {
19
19
  clear(): void;
20
20
  get(): any;
21
21
  array(): any;
22
+ getArrayLength(): any;
22
23
  set(value: any): void | Float | ABAPObject | this | Table | Structure;
23
24
  getOffset(input: {
24
25
  offset?: number | INumeric | Hex;
@@ -42,6 +42,11 @@ class DataReference {
42
42
  // @ts-ignore
43
43
  return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.array();
44
44
  }
45
+ getArrayLength() {
46
+ var _a;
47
+ // @ts-ignore
48
+ return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.getArrayLength();
49
+ }
45
50
  set(value) {
46
51
  var _a;
47
52
  if (value instanceof DataReference) {
@@ -23,6 +23,7 @@ export declare class FieldSymbol {
23
23
  get(): any;
24
24
  appendInitial(): import("./table").TableRowType | undefined;
25
25
  array(): any;
26
+ getArrayLength(): any;
26
27
  set(value: any): this;
27
28
  getOffset(input: {
28
29
  offset?: number | INumeric | Hex;
@@ -87,6 +87,11 @@ class FieldSymbol {
87
87
  // @ts-ignore
88
88
  return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.array();
89
89
  }
90
+ getArrayLength() {
91
+ var _a;
92
+ // @ts-ignore
93
+ return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.getArrayLength();
94
+ }
90
95
  set(value) {
91
96
  var _a;
92
97
  (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.set(value);
@@ -29,7 +29,7 @@ interface ITable {
29
29
  getQualifiedName(): string | undefined;
30
30
  getOptions(): ITableOptions | undefined;
31
31
  getRowType(): TableRowType;
32
- getLength(): number;
32
+ getArrayLength(): number;
33
33
  clear(): void;
34
34
  set(tab: Table | HashedTable | TableRowType): ITable;
35
35
  getHeader(): TableRowType;
@@ -48,7 +48,7 @@ export declare class HashedTable implements ITable {
48
48
  private readonly qualifiedName;
49
49
  private secondaryIndexes;
50
50
  constructor(rowType: TableRowType, options: ITableOptions, qualifiedName?: string);
51
- getLength(): number;
51
+ getArrayLength(): number;
52
52
  getKeyByName(name: string): ITableKey | undefined;
53
53
  getSecondaryIndex(name: string): any[];
54
54
  buildHashFromData(data: TableRowType): string;
@@ -83,7 +83,7 @@ export declare class Table implements ITable {
83
83
  private readonly isStructured;
84
84
  private secondaryIndexes;
85
85
  constructor(rowType: TableRowType, options: ITableOptions, qualifiedName?: string);
86
- getLength(): number;
86
+ getArrayLength(): number;
87
87
  getKeyByName(name: string): ITableKey | undefined;
88
88
  getSecondaryIndex(name: string): TableRowType[];
89
89
  getQualifiedName(): string | undefined;
@@ -65,7 +65,7 @@ class HashedTable {
65
65
  }
66
66
  this.qualifiedName = qualifiedName === null || qualifiedName === void 0 ? void 0 : qualifiedName.toUpperCase();
67
67
  }
68
- getLength() {
68
+ getArrayLength() {
69
69
  return Object.keys(this.value).length;
70
70
  }
71
71
  getKeyByName(name) {
@@ -221,7 +221,7 @@ class Table {
221
221
  }
222
222
  this.qualifiedName = qualifiedName === null || qualifiedName === void 0 ? void 0 : qualifiedName.toUpperCase();
223
223
  }
224
- getLength() {
224
+ getArrayLength() {
225
225
  return this.value.length;
226
226
  }
227
227
  getKeyByName(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.5.60",
3
+ "version": "2.5.62",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",