@abaplint/runtime 2.5.21 → 2.5.23

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.
@@ -8,11 +8,11 @@ class SelectDatabase {
8
8
  this.context = context;
9
9
  }
10
10
  async select(target, input, runtimeOptions) {
11
- var _a;
11
+ var _a, _b;
12
12
  const { rows: rows } = await this.context.defaultDB().select(input);
13
13
  if (target instanceof types_1.FieldSymbol) {
14
14
  if (target.isAssigned() === false) {
15
- throw "select, fs not assigned";
15
+ throw new Error("GETWA_NOT_ASSIGNED");
16
16
  }
17
17
  // @ts-ignore
18
18
  target = target.getPointer();
@@ -39,8 +39,12 @@ class SelectDatabase {
39
39
  if (targetRow instanceof types_1.Structure) {
40
40
  for (let columnName in row) {
41
41
  columnName = columnName.toLowerCase();
42
+ if (row[columnName] === null) {
43
+ (_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.clear();
44
+ continue;
45
+ }
42
46
  // @ts-ignore
43
- (_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.set(row[columnName]);
47
+ (_b = targetRow.get()[columnName]) === null || _b === void 0 ? void 0 : _b.set(row[columnName]);
44
48
  }
45
49
  }
46
50
  else {
@@ -4,8 +4,11 @@ exports.templateFormatting = void 0;
4
4
  const types_1 = require("./types");
5
5
  function templateFormatting(source, options) {
6
6
  let text = "";
7
- if (source instanceof types_1.FieldSymbol && source.getPointer() === undefined) {
8
- throw new Error("GETWA_NOT_ASSIGNED");
7
+ if (source instanceof types_1.FieldSymbol) {
8
+ if (source.getPointer() === undefined) {
9
+ throw new Error("GETWA_NOT_ASSIGNED");
10
+ }
11
+ return templateFormatting(source.getPointer(), options);
9
12
  }
10
13
  else if (source instanceof types_1.Table) {
11
14
  throw new Error("STRG_ILLEGAL_DATA_TYPE");
@@ -1,3 +1,4 @@
1
+ import { FieldSymbol } from "./field_symbol";
1
2
  import { Hex } from "./hex";
2
3
  import { ICharacter } from "./_character";
3
4
  import { INumeric } from "./_numeric";
@@ -8,7 +9,7 @@ export declare class String implements ICharacter {
8
9
  qualifiedName?: string;
9
10
  });
10
11
  getQualifiedName(): string | undefined;
11
- set(value: ICharacter | string | number): this;
12
+ set(value: ICharacter | string | number | FieldSymbol): String;
12
13
  clear(): void;
13
14
  get(): string;
14
15
  getOffset(input: {
@@ -4,6 +4,7 @@ exports.String = void 0;
4
4
  const _parse_1 = require("../operators/_parse");
5
5
  const throw_error_1 = require("../throw_error");
6
6
  const character_1 = require("./character");
7
+ const field_symbol_1 = require("./field_symbol");
7
8
  const integer_1 = require("./integer");
8
9
  const structure_1 = require("./structure");
9
10
  class String {
@@ -15,7 +16,13 @@ class String {
15
16
  return this.qualifiedName;
16
17
  }
17
18
  set(value) {
18
- if (typeof value === "string") {
19
+ if (value instanceof field_symbol_1.FieldSymbol) {
20
+ if (value.getPointer() === undefined) {
21
+ throw new Error("GETWA_NOT_ASSIGNED");
22
+ }
23
+ return this.set(value.getPointer());
24
+ }
25
+ else if (typeof value === "string") {
19
26
  this.value = value;
20
27
  }
21
28
  else if (typeof value === "number") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.5.21",
3
+ "version": "2.5.23",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",