@abaplint/runtime 2.10.36 → 2.10.38

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.
@@ -138,10 +138,15 @@ function assign(input) {
138
138
  abap.builtin.sy.get().subrc.set(4);
139
139
  }
140
140
  else {
141
- if (input.casting) {
142
- input.target.setCasting();
141
+ if (input.source instanceof types_1.Table && input.source.getOptions()?.withHeader === true) {
142
+ input.target.assign(input.source.getHeader());
143
+ }
144
+ else {
145
+ if (input.casting) {
146
+ input.target.setCasting();
147
+ }
148
+ input.target.assign(input.source);
143
149
  }
144
- input.target.assign(input.source);
145
150
  // @ts-ignore
146
151
  abap.builtin.sy.get().subrc.set(0);
147
152
  }
@@ -14,5 +14,5 @@ export interface IWriteOptions {
14
14
  export declare class WriteStatement {
15
15
  private readonly context;
16
16
  constructor(context: Context);
17
- write(source: INumeric | ICharacter | FieldSymbol | string | number, options?: IWriteOptions): void;
17
+ write(source: INumeric | ICharacter | FieldSymbol | string | number | undefined, options?: IWriteOptions): void;
18
18
  }
@@ -9,6 +9,9 @@ class WriteStatement {
9
9
  }
10
10
  write(source, options) {
11
11
  let right = false;
12
+ if (source === undefined) {
13
+ throw new Error("WriteStatement: source is undefined");
14
+ }
12
15
  if (options?.skipLine === true) {
13
16
  this.context.console.add("\n");
14
17
  }
@@ -104,6 +104,7 @@ export declare class Table implements ITable {
104
104
  clear(): void;
105
105
  set(tab: Table | TableRowType): this;
106
106
  getHeader(): TableRowType;
107
+ get(): TableRowType;
107
108
  insertIndex(item: TableRowType, index: number, noClone?: boolean): any;
108
109
  /** index = javascript indexed */
109
110
  deleteIndex(index: number): void;
@@ -375,10 +375,16 @@ class Table {
375
375
  }
376
376
  getHeader() {
377
377
  if (this.header === undefined) {
378
- throw "table, getHeader";
378
+ throw new Error("table, getHeader");
379
379
  }
380
380
  return this.header;
381
381
  }
382
+ get() {
383
+ if (this.header === undefined) {
384
+ throw new Error("table, no header line");
385
+ }
386
+ return this.header.get();
387
+ }
382
388
  insertIndex(item, index, noClone = false) {
383
389
  this.secondaryIndexes = {};
384
390
  if (item instanceof field_symbol_1.FieldSymbol) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.36",
3
+ "version": "2.10.38",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "chai": "^4.5.0",
35
35
  "mocha": "^11.1.0",
36
36
  "source-map-support": "^0.5.21",
37
- "typescript": "^5.8.2"
37
+ "typescript": "^5.8.3"
38
38
  },
39
39
  "dependencies": {
40
40
  "temporal-polyfill": "^0.2.5"