@abaplint/runtime 2.4.11 → 2.4.12

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.
@@ -2,8 +2,6 @@ import { INumeric } from "./_numeric";
2
2
  import { ICharacter } from "./_character";
3
3
  import { ABAPObject } from "./abap_object";
4
4
  import { Structure } from "./structure";
5
- import { FieldSymbol } from "./field_symbol";
6
- import { DataReference } from "./data_reference";
7
5
  export declare enum TableAccessType {
8
6
  standard = "STANDARD",
9
7
  sorted = "SORTED",
@@ -48,9 +46,9 @@ export declare class Table {
48
46
  clear(): void;
49
47
  set(tab: Table | TableRowType): void;
50
48
  getHeader(): TableRowType;
51
- insertIndex(item: TableRowType, index: number): TableRowType;
49
+ insertIndex(item: TableRowType, index: number): any;
52
50
  deleteIndex(index: number): void;
53
- append(item: TableRowType): FieldSymbol | DataReference | TableRowType;
51
+ append(item: TableRowType): any;
54
52
  appendInitial(): TableRowType;
55
53
  sort(compareFn: (a: TableRowType, b: TableRowType) => number): void;
56
54
  private getValue;
@@ -115,6 +115,14 @@ class Table {
115
115
  }
116
116
  insertIndex(item, index) {
117
117
  this.secondaryIndexes = {};
118
+ if (item instanceof field_symbol_1.FieldSymbol) {
119
+ const p = item.getPointer();
120
+ if (p === undefined) {
121
+ throw new Error("insertIndex, fs not assigned");
122
+ }
123
+ this.insertIndex(p, index);
124
+ return p;
125
+ }
118
126
  const val = this.getValue(item);
119
127
  if (index === 0) {
120
128
  this.value.unshift(val);
@@ -156,23 +164,14 @@ class Table {
156
164
  if (p === undefined) {
157
165
  throw new Error("APPEND, fs not assigned");
158
166
  }
159
- this.value.push(p);
160
- return item;
167
+ this.append(p);
168
+ return p;
161
169
  }
162
170
  else if (item instanceof data_reference_1.DataReference) {
163
171
  const ref = new data_reference_1.DataReference(item.getType());
164
172
  ref.assign(item.getPointer());
165
173
  this.value.push(ref);
166
174
  return ref;
167
- // @ts-ignore
168
- // eslint-disable-next-line max-len
169
- }
170
- else if (this.isStructured === true && item.getQualifiedName && this.rowType.getQualifiedName && item.getQualifiedName() !== "" && item.getQualifiedName() === this.rowType.getQualifiedName()) {
171
- // hmm, moving this to getValue() should, but does not work
172
- // types match, so no need to do conversions, just clone the item
173
- const val = (0, clone_1.clone)(item);
174
- this.value.push(val);
175
- return val;
176
175
  }
177
176
  else {
178
177
  const val = this.getValue(item);
@@ -203,6 +202,13 @@ class Table {
203
202
  const tmp = (0, clone_1.clone)(this.getRowType());
204
203
  tmp.set(new string_1.String().set(item));
205
204
  return tmp;
205
+ // @ts-ignore
206
+ // eslint-disable-next-line max-len
207
+ }
208
+ else if (this.isStructured === true && item.getQualifiedName && this.rowType.getQualifiedName && item.getQualifiedName() !== "" && item.getQualifiedName() === this.rowType.getQualifiedName()) {
209
+ // types match, so no need to do conversions, just clone the item
210
+ const val = (0, clone_1.clone)(item);
211
+ return val;
206
212
  }
207
213
  else {
208
214
  const tmp = (0, clone_1.clone)(this.getRowType());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",