@abaplint/runtime 2.4.20 → 2.4.21

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.
@@ -12,7 +12,7 @@ function cp(left, right) {
12
12
  }
13
13
  else if (left instanceof types_1.FieldSymbol) {
14
14
  if (left.getPointer() === undefined) {
15
- throw "GETWA_NOT_ASSIGNED";
15
+ throw new Error("GETWA_NOT_ASSIGNED");
16
16
  }
17
17
  return cp(left.getPointer(), right);
18
18
  }
@@ -6,13 +6,13 @@ const integer_1 = require("../types/integer");
6
6
  function gt(left, right) {
7
7
  if (left instanceof types_1.FieldSymbol) {
8
8
  if (left.getPointer() === undefined) {
9
- throw "GETWA_NOT_ASSIGNED";
9
+ throw new Error("GETWA_NOT_ASSIGNED");
10
10
  }
11
11
  return gt(left.getPointer(), right);
12
12
  }
13
13
  else if (right instanceof types_1.FieldSymbol) {
14
14
  if (right.getPointer() === undefined) {
15
- throw "GETWA_NOT_ASSIGNED";
15
+ throw new Error("GETWA_NOT_ASSIGNED");
16
16
  }
17
17
  return gt(left, right.getPointer());
18
18
  }
@@ -4,6 +4,7 @@ exports.assign = void 0;
4
4
  const types_1 = require("../types");
5
5
  function assign(input) {
6
6
  var _a;
7
+ // console.dir(input);
7
8
  if (input.dynamicName) {
8
9
  if (input.dynamicSource instanceof types_1.FieldSymbol) {
9
10
  input.dynamicSource = input.dynamicSource.getPointer();
@@ -110,19 +111,26 @@ function assign(input) {
110
111
  else {
111
112
  // console.dir(input);
112
113
  if (input.source instanceof types_1.FieldSymbol) {
113
- input.target.assign(input.source.getPointer());
114
- // } else if (input.source instanceof DataReference) {
115
- // input.target.assign(input.source.getPointer());
116
- // console.dir(input.target);
114
+ const pnt = input.source.getPointer();
115
+ if (pnt === undefined) {
116
+ throw new Error("GETWA_NOT_ASSIGNED");
117
+ }
118
+ input.target.assign(pnt);
119
+ // @ts-ignore
120
+ abap.builtin.sy.get().subrc.set(0);
121
+ }
122
+ else if (input.source === undefined) {
123
+ // @ts-ignore
124
+ abap.builtin.sy.get().subrc.set(4);
117
125
  }
118
126
  else {
119
127
  if (input.casting) {
120
128
  input.target.setCasting();
121
129
  }
122
130
  input.target.assign(input.source);
131
+ // @ts-ignore
132
+ abap.builtin.sy.get().subrc.set(0);
123
133
  }
124
- // @ts-ignore
125
- abap.builtin.sy.get().subrc.set(0);
126
134
  }
127
135
  }
128
136
  exports.assign = assign;
@@ -17,7 +17,7 @@ async function cast(target, source) {
17
17
  // eslint-disable-next-line prefer-const
18
18
  let checkIntf = true;
19
19
  if (target instanceof types_1.FieldSymbol && target.getPointer() === undefined) {
20
- throw "GETWA_NOT_ASSIGNED";
20
+ throw new Error("GETWA_NOT_ASSIGNED");
21
21
  }
22
22
  let targetName = undefined;
23
23
  if (target.getQualifiedName) {
@@ -55,7 +55,7 @@ function loop(table, options) {
55
55
  else if (table instanceof types_1.FieldSymbol) {
56
56
  const pnt = table.getPointer();
57
57
  if (pnt === undefined) {
58
- throw "GETWA_NOT_ASSIGNED";
58
+ throw new Error("GETWA_NOT_ASSIGNED");
59
59
  }
60
60
  yield __await(yield* __asyncDelegator(__asyncValues(loop(pnt, options))));
61
61
  return yield __await(void 0);
@@ -30,7 +30,7 @@ function sort(input, options) {
30
30
  if (input instanceof types_1.FieldSymbol) {
31
31
  const pnt = input.getPointer();
32
32
  if (pnt === undefined) {
33
- throw "GETWA_NOT_ASSIGNED";
33
+ throw new Error("GETWA_NOT_ASSIGNED");
34
34
  }
35
35
  sort(pnt, options);
36
36
  return;
@@ -5,10 +5,10 @@ const types_1 = require("./types");
5
5
  function templateFormatting(source, options) {
6
6
  let text = "";
7
7
  if (source instanceof types_1.FieldSymbol && source.getPointer() === undefined) {
8
- throw "GETWA_NOT_ASSIGNED";
8
+ throw new Error("GETWA_NOT_ASSIGNED");
9
9
  }
10
10
  else if (source instanceof types_1.Table) {
11
- throw "STRG_ILLEGAL_DATA_TYPE";
11
+ throw new Error("STRG_ILLEGAL_DATA_TYPE");
12
12
  }
13
13
  else if (source instanceof types_1.Character) {
14
14
  text = source.getTrimEnd();
@@ -25,7 +25,7 @@ class Character {
25
25
  }
26
26
  else if (value instanceof field_symbol_1.FieldSymbol) {
27
27
  if (value.getPointer() === undefined) {
28
- throw "GETWA_NOT_ASSIGNED";
28
+ throw new Error("GETWA_NOT_ASSIGNED");
29
29
  }
30
30
  this.set(value.getPointer());
31
31
  return this;
@@ -50,14 +50,14 @@ class DataReference {
50
50
  }
51
51
  else if (value instanceof field_symbol_1.FieldSymbol) {
52
52
  if (value.getPointer() === undefined) {
53
- throw "GETWA_NOT_ASSIGNED";
53
+ throw new Error("GETWA_NOT_ASSIGNED");
54
54
  }
55
55
  else if (value.getPointer() instanceof DataReference) {
56
56
  this.pointer = value.getPointer();
57
57
  return this;
58
58
  }
59
59
  else {
60
- throw "OBJECTS_MOVE_NOT_SUPPORTED";
60
+ throw new Error("OBJECTS_MOVE_NOT_SUPPORTED");
61
61
  }
62
62
  }
63
63
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.4.20",
3
+ "version": "2.4.21",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",