@abaplint/runtime 2.13.51 → 2.13.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,4 +1,4 @@
1
- import { ABAPObject, DataReference, FieldSymbol, Integer8, Structure, Table } from "../types";
1
+ import { ABAPObject, DataReference, DecFloat34, FieldSymbol, Integer8, Structure, Table } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function initial(val: ICharacter | INumeric | string | number | Integer8 | Structure | DataReference | FieldSymbol | Table | ABAPObject): boolean;
4
+ export declare function initial(val: ICharacter | INumeric | string | number | Integer8 | DecFloat34 | Structure | DataReference | FieldSymbol | Table | ABAPObject): boolean;
@@ -27,7 +27,7 @@ function initial(val) {
27
27
  else if (val instanceof types_1.Time) {
28
28
  return val.get() === "000000";
29
29
  }
30
- else if (val instanceof types_1.Float) {
30
+ else if (val instanceof types_1.Float || val instanceof types_1.DecFloat34) {
31
31
  return val.getRaw() === 0;
32
32
  }
33
33
  else if (val instanceof types_1.Character) {
@@ -27,7 +27,7 @@ function assign(input) {
27
27
  else if (upperS === "TABLE_LINE" && input.dynamicSource instanceof types_1.DataReference) {
28
28
  // @ts-ignore
29
29
  input.dynamicSource = input.dynamicSource.getPointer();
30
- if (input.dynamicSource instanceof types_1.Table) {
30
+ if (input.dynamicSource instanceof types_1.Table || input.dynamicSource instanceof types_1.HashedTable) {
31
31
  const options = input.dynamicSource.getOptions();
32
32
  if (options?.withHeader === true) {
33
33
  // @ts-ignore
@@ -39,14 +39,29 @@ function assign(input) {
39
39
  }
40
40
  }
41
41
  else {
42
- // @ts-ignore
43
- const source = input.dynamicSource.get();
42
+ let sourceContainer = input.dynamicSource;
43
+ if (sourceContainer instanceof types_1.DataReference) {
44
+ sourceContainer = sourceContainer.getPointer();
45
+ }
46
+ if (sourceContainer instanceof types_1.Table || sourceContainer instanceof types_1.HashedTable) {
47
+ if (sourceContainer.getOptions()?.withHeader === true) {
48
+ sourceContainer = sourceContainer.getHeader();
49
+ }
50
+ else {
51
+ abap.builtin.sy.get().subrc.set(4);
52
+ return;
53
+ }
54
+ }
55
+ const source = sourceContainer?.get();
44
56
  if (source === undefined) {
45
57
  abap.builtin.sy.get().subrc.set(4);
46
58
  return;
47
59
  }
60
+ const componentName = sourceContainer instanceof types_1.Structure
61
+ ? s.toLowerCase()
62
+ : s.toLowerCase().replace(/[~\\/]/g, "$");
48
63
  // @ts-ignore
49
- input.dynamicSource = source[s.toLowerCase().replace(/[~\\/]/g, "$")];
64
+ input.dynamicSource = source[componentName];
50
65
  }
51
66
  }
52
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.13.51",
3
+ "version": "2.13.53",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",