@abaplint/runtime 2.1.34 → 2.1.35

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.
@@ -25,6 +25,9 @@ function initial(val) {
25
25
  else if (val instanceof types_1.Character) {
26
26
  return val.get().match(/^ *$/) !== null;
27
27
  }
28
+ else if (val instanceof types_1.FieldSymbol && val.getPointer() === undefined) {
29
+ throw "FS not assigned";
30
+ }
28
31
  if (typeof val === "string") {
29
32
  return val === "";
30
33
  }
@@ -4,7 +4,7 @@ import { INumeric } from "../types/_numeric";
4
4
  export interface IAssignInput {
5
5
  source?: INumeric | ICharacter | Structure | DataReference;
6
6
  target: FieldSymbol;
7
- dynamicText?: string;
7
+ dynamicName?: string;
8
8
  dynamicSource?: ICharacter;
9
9
  casting?: boolean;
10
10
  component?: string | ICharacter;
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assign = void 0;
4
4
  const types_1 = require("../types");
5
5
  function assign(input) {
6
- if (input.dynamicText) {
6
+ // console.dir(input);
7
+ if (input.dynamicName) {
7
8
  if (input.dynamicSource instanceof types_1.FieldSymbol) {
8
9
  input.dynamicSource = input.dynamicSource.getPointer();
9
10
  }
10
- if (input.dynamicText.includes("->")) {
11
+ if (input.dynamicName.includes("->")) {
11
12
  if (input.dynamicSource instanceof types_1.ABAPObject) {
12
- const split = input.dynamicText.split("->");
13
+ const split = input.dynamicName.split("->");
13
14
  // @ts-ignore
14
15
  input.dynamicSource = input.dynamicSource.get()[split[1].toLowerCase()];
15
16
  }
@@ -19,6 +20,28 @@ function assign(input) {
19
20
  return;
20
21
  }
21
22
  }
23
+ else if (input.dynamicName.includes("=>")) {
24
+ const split = input.dynamicName.split("=>");
25
+ // @ts-ignore
26
+ const clas = abap.Classes[split[0].toUpperCase()];
27
+ if (clas === undefined) {
28
+ // @ts-ignore
29
+ abap.builtin.sy.get().subrc.set(4);
30
+ return;
31
+ }
32
+ if (clas[split[1].toLowerCase()] !== undefined) {
33
+ input.target.assign(clas[split[1].toLowerCase()]);
34
+ // @ts-ignore
35
+ abap.builtin.sy.get().subrc.set(0);
36
+ return;
37
+ }
38
+ else if (clas[split[0].toLowerCase() + "$" + split[1].toLowerCase()] !== undefined) {
39
+ input.target.assign(clas[split[0].toLowerCase() + "$" + split[1].toLowerCase()]);
40
+ // @ts-ignore
41
+ abap.builtin.sy.get().subrc.set(0);
42
+ return;
43
+ }
44
+ }
22
45
  if (input.dynamicSource) {
23
46
  input.target.assign(input.dynamicSource);
24
47
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.1.34",
3
+ "version": "2.1.35",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",