@abaplint/runtime 2.3.44 → 2.3.45

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,2 +1,2 @@
1
- import { ABAPObject } from "../types";
2
- export declare function cast(target: ABAPObject, source: ABAPObject): Promise<void>;
1
+ import { ABAPObject, FieldSymbol } from "../types";
2
+ export declare function cast(target: ABAPObject | FieldSymbol, source: ABAPObject): Promise<void>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cast = void 0;
4
4
  const compare_1 = require("../compare");
5
5
  const throw_error_1 = require("../throw_error");
6
+ const types_1 = require("../types");
6
7
  // todo, field symbols as input?
7
8
  // todo, local classes?
8
9
  // check with javascript instanceof?
@@ -15,6 +16,9 @@ async function cast(target, source) {
15
16
  }
16
17
  // eslint-disable-next-line prefer-const
17
18
  let checkIntf = true;
19
+ if (target instanceof types_1.FieldSymbol && target.getPointer() === undefined) {
20
+ throw "GETWA_NOT_ASSIGNED";
21
+ }
18
22
  const targetName = (_a = target.getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
19
23
  // @ts-ignore
20
24
  const targetClass = abap.Classes[targetName];
@@ -2,7 +2,7 @@ import { Context } from "../context";
2
2
  import { FieldSymbol, Structure, Table } from "../types";
3
3
  import { ICharacter } from "../types/_character";
4
4
  export interface IModifyDatabaseOptions {
5
- values?: Structure;
5
+ values?: Structure | FieldSymbol;
6
6
  table?: Table | FieldSymbol;
7
7
  }
8
8
  export declare class ModifyDatabase {
@@ -11,6 +11,7 @@ export declare class FieldSymbol {
11
11
  private casting;
12
12
  private readonly type;
13
13
  constructor(type?: PointerType);
14
+ getQualifiedName(): any;
14
15
  assign(pointer: PointerType): void;
15
16
  setCasting(): void;
16
17
  unassign(): void;
@@ -12,6 +12,10 @@ class FieldSymbol {
12
12
  this.casting = false;
13
13
  this.type = type;
14
14
  }
15
+ getQualifiedName() {
16
+ // @ts-ignore
17
+ return this.type.getQualifiedName();
18
+ }
15
19
  assign(pointer) {
16
20
  this.pointer = pointer;
17
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.3.44",
3
+ "version": "2.3.45",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",