@abaplint/runtime 2.10.1 → 2.10.3

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.
@@ -69,8 +69,11 @@ async function deleteInternal(target, options) {
69
69
  target.deleteFrom(options.fromValue);
70
70
  return;
71
71
  }
72
- // @ts-ignore
73
- const originalTabix = abap.builtin.sy.get().tabix.get();
72
+ // short form, "DELETE tab"
73
+ if (options === undefined) {
74
+ target.deleteIndex(target.getCurrentLoopIndex());
75
+ return;
76
+ }
74
77
  for await (const i of (0, loop_1.loop)(target)) {
75
78
  // @ts-ignore
76
79
  index = abap.builtin.sy.get().tabix.get() - 1;
@@ -95,11 +98,6 @@ async function deleteInternal(target, options) {
95
98
  else if (options?.from && options.from.get() <= index + 1) {
96
99
  target.deleteIndex(index);
97
100
  }
98
- else if (options === undefined && originalTabix === index + 1) {
99
- // short form, "DELETE tab"
100
- target.deleteIndex(index);
101
- break;
102
- }
103
101
  }
104
102
  }
105
103
  //# sourceMappingURL=delete_internal.js.map
@@ -127,6 +127,11 @@ function readTable(table, options) {
127
127
  }
128
128
  }
129
129
  found = arr[index - 1];
130
+ if (found
131
+ && options?.withKey
132
+ && options?.withKey(found.get()) === false) {
133
+ found = undefined;
134
+ }
130
135
  if (found) {
131
136
  foundIndex = index;
132
137
  }
@@ -97,6 +97,7 @@ export declare class Table implements ITable {
97
97
  getQualifiedName(): string | undefined;
98
98
  getOptions(): ITableOptions;
99
99
  startLoop(from: number, to: number, array: any[]): LoopController;
100
+ getCurrentLoopIndex(): number;
100
101
  unregisterLoop(loop: LoopController): void;
101
102
  getRowType(): TableRowType;
102
103
  array(): any[];
@@ -322,6 +322,12 @@ class Table {
322
322
  this.loops.add(l);
323
323
  return l;
324
324
  }
325
+ getCurrentLoopIndex() {
326
+ if (this.loops.size !== 1) {
327
+ throw new Error("More than one LOOP");
328
+ }
329
+ return Array.from(this.loops)[0].index;
330
+ }
325
331
  unregisterLoop(loop) {
326
332
  this.loops.delete(loop);
327
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.1",
3
+ "version": "2.10.3",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",