@abaplint/runtime 2.1.28 → 2.1.31
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Table } from "../types";
|
|
1
|
+
import { FieldSymbol, Table } from "../types";
|
|
2
2
|
import { INumeric } from "../types/_numeric";
|
|
3
3
|
export interface IDeleteInternalOptions {
|
|
4
4
|
where?: (i: any) => boolean;
|
|
@@ -9,4 +9,4 @@ export interface IDeleteInternalOptions {
|
|
|
9
9
|
from?: any;
|
|
10
10
|
to?: any;
|
|
11
11
|
}
|
|
12
|
-
export declare function deleteInternal(target: Table, options?: IDeleteInternalOptions): void;
|
|
12
|
+
export declare function deleteInternal(target: Table | FieldSymbol, options?: IDeleteInternalOptions): void;
|
|
@@ -7,14 +7,29 @@ const loop_1 = require("./loop");
|
|
|
7
7
|
function deleteInternal(target, options) {
|
|
8
8
|
let prev = undefined;
|
|
9
9
|
let index = 0;
|
|
10
|
+
if (target instanceof types_1.FieldSymbol) {
|
|
11
|
+
target = target.getPointer();
|
|
12
|
+
if (target === undefined) {
|
|
13
|
+
throw "FS not assigned";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
10
16
|
if ((options === null || options === void 0 ? void 0 : options.index)
|
|
11
17
|
&& (options === null || options === void 0 ? void 0 : options.where) === undefined
|
|
12
18
|
&& (options === null || options === void 0 ? void 0 : options.adjacent) === undefined
|
|
13
19
|
&& (options === null || options === void 0 ? void 0 : options.fromValue) === undefined
|
|
14
20
|
&& (options === null || options === void 0 ? void 0 : options.from) === undefined
|
|
15
21
|
&& (options === null || options === void 0 ? void 0 : options.to) === undefined) {
|
|
16
|
-
target.
|
|
17
|
-
|
|
22
|
+
if (target.array()[options.index.get() - 1] === undefined) {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
target.deleteIndex(options.index.get() - 1);
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
for (const i of (0, loop_1.loop)(target)) {
|
|
20
35
|
// @ts-ignore
|
|
@@ -27,7 +27,9 @@ export declare class Table {
|
|
|
27
27
|
private readonly rowType;
|
|
28
28
|
private readonly loops;
|
|
29
29
|
private readonly options;
|
|
30
|
-
|
|
30
|
+
private readonly qualifiedName;
|
|
31
|
+
constructor(rowType: TableRowType, options?: ITableOptions, qualifiedName?: string);
|
|
32
|
+
getQualifiedName(): string | undefined;
|
|
31
33
|
getOptions(): ITableOptions | undefined;
|
|
32
34
|
startLoop(start?: number): LoopIndex;
|
|
33
35
|
unregisterLoop(loop: LoopIndex): void;
|
package/build/src/types/table.js
CHANGED
|
@@ -22,11 +22,15 @@ class LoopIndex {
|
|
|
22
22
|
}
|
|
23
23
|
exports.LoopIndex = LoopIndex;
|
|
24
24
|
class Table {
|
|
25
|
-
constructor(rowType, options) {
|
|
25
|
+
constructor(rowType, options, qualifiedName) {
|
|
26
26
|
this.value = [];
|
|
27
27
|
this.loops = new Set();
|
|
28
28
|
this.rowType = rowType;
|
|
29
29
|
this.options = options;
|
|
30
|
+
this.qualifiedName = qualifiedName === null || qualifiedName === void 0 ? void 0 : qualifiedName.toUpperCase();
|
|
31
|
+
}
|
|
32
|
+
getQualifiedName() {
|
|
33
|
+
return this.qualifiedName;
|
|
30
34
|
}
|
|
31
35
|
getOptions() {
|
|
32
36
|
return this.options;
|