@abaplint/runtime 2.7.51 → 2.7.53

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,3 +1,4 @@
1
+ import { Structure } from "../types";
1
2
  import { ICharacter } from "../types/_character";
2
3
  import { INumeric } from "../types/_numeric";
3
- export declare function ca(left: number | string | ICharacter | INumeric, right: string | ICharacter): boolean;
4
+ export declare function ca(left: number | string | ICharacter | INumeric | Structure, right: string | ICharacter): boolean;
@@ -1,11 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ca = void 0;
4
+ const types_1 = require("../types");
4
5
  function ca(left, right) {
6
+ if (left instanceof types_1.FieldSymbol) {
7
+ return ca(left.getPointer(), right);
8
+ }
9
+ else if (right instanceof types_1.FieldSymbol) {
10
+ return ca(left, right.getPointer());
11
+ }
5
12
  let l = "";
6
13
  if (typeof left === "number" || typeof left === "string") {
7
14
  l = left.toString();
8
15
  }
16
+ else if (left instanceof types_1.Structure) {
17
+ l = left.getCharacter();
18
+ }
9
19
  else {
10
20
  l = left.get().toString();
11
21
  }
@@ -73,6 +73,8 @@ async function deleteInternal(target, options) {
73
73
  }
74
74
  return;
75
75
  }
76
+ // @ts-ignore
77
+ const originalTabix = abap.builtin.sy.get().tabix.get();
76
78
  try {
77
79
  for (var _d = true, _e = __asyncValues((0, loop_1.loop)(target)), _f; _f = await _e.next(), _a = _f.done, !_a; _d = true) {
78
80
  _c = _f.value;
@@ -93,6 +95,7 @@ async function deleteInternal(target, options) {
93
95
  }
94
96
  else if ((options === null || options === void 0 ? void 0 : options.index) && options.index.get() === index) {
95
97
  target.deleteIndex(options.index.get() - 1);
98
+ break;
96
99
  }
97
100
  else if ((options === null || options === void 0 ? void 0 : options.fromValue) && (0, compare_1.eq)(options.fromValue, i)) {
98
101
  target.deleteIndex(index);
@@ -100,6 +103,11 @@ async function deleteInternal(target, options) {
100
103
  else if ((options === null || options === void 0 ? void 0 : options.from) && options.from.get() <= index + 1) {
101
104
  target.deleteIndex(index);
102
105
  }
106
+ else if (options === undefined && originalTabix === index + 1) {
107
+ // short form, "DELETE tab"
108
+ target.deleteIndex(index);
109
+ break;
110
+ }
103
111
  }
104
112
  }
105
113
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -107,6 +107,7 @@ export declare class Table implements ITable {
107
107
  set(tab: Table | TableRowType): this;
108
108
  getHeader(): TableRowType;
109
109
  insertIndex(item: TableRowType, index: number, noClone?: boolean): any;
110
+ /** index = javascript indexed */
110
111
  deleteIndex(index: number): void;
111
112
  append(item: TableRowType): any;
112
113
  appendInitial(): TableRowType;
@@ -364,6 +364,7 @@ class Table {
364
364
  }
365
365
  return val;
366
366
  }
367
+ /** index = javascript indexed */
367
368
  deleteIndex(index) {
368
369
  this.secondaryIndexes = {};
369
370
  if (index > this.value.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.51",
3
+ "version": "2.7.53",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",