@abaplint/runtime 1.7.31 → 1.7.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.
@@ -19,6 +19,8 @@ function append(input) {
19
19
  }
20
20
  }
21
21
  }
22
+ // @ts-ignore
23
+ abap.builtin.sy.get().tabix.set(input.target.array().length);
22
24
  }
23
25
  exports.append = append;
24
26
  //# sourceMappingURL=append.js.map
@@ -4,7 +4,7 @@ import { INumeric } from "../types/_numeric";
4
4
  export interface IInsertInternalOptions {
5
5
  index?: INumeric;
6
6
  initial?: boolean;
7
- data?: INumeric | ICharacter | Structure | ABAPObject | Table;
7
+ data?: INumeric | ICharacter | Structure | ABAPObject | Table | string;
8
8
  table: Table;
9
9
  referenceInto?: DataReference;
10
10
  assigning?: FieldSymbol;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.insertInternal = void 0;
4
+ const clone_1 = require("../clone");
4
5
  const compare_1 = require("../compare");
5
6
  const types_1 = require("../types");
6
7
  const read_table_1 = require("./read_table");
@@ -27,9 +28,15 @@ function insertInternal(options) {
27
28
  return;
28
29
  }
29
30
  }
30
- if (options.data && options.index) {
31
+ let data = options.data;
32
+ if (typeof data === "string") {
33
+ const tmp = (0, clone_1.clone)(options.table.getRowType());
34
+ tmp.set(data);
35
+ data = tmp;
36
+ }
37
+ if (data && options.index) {
31
38
  const index = options.index.get() - 1;
32
- const val = options.table.insertIndex(options.data, index);
39
+ const val = options.table.insertIndex(data, index);
33
40
  if (options.assigning) {
34
41
  options.assigning.assign(val);
35
42
  }
@@ -49,9 +56,9 @@ function insertInternal(options) {
49
56
  options.assigning.assign(val);
50
57
  }
51
58
  }
52
- else if (options.data) {
59
+ else if (data) {
53
60
  // todo, for now it just appends, this is not correct, but currently the table type is not known
54
- const val = options.table.insertIndex(options.data, options.table.array().length);
61
+ const val = options.table.insertIndex(data, options.table.array().length);
55
62
  if (options.assigning) {
56
63
  options.assigning.assign(val);
57
64
  }
@@ -16,6 +16,16 @@ class Integer {
16
16
  this.value = 0;
17
17
  }
18
18
  else if (typeof value === "string") {
19
+ if (/[a-z]/i.test(value) === true) { // todo, match more here?
20
+ // @ts-ignore
21
+ if (abap.Classes["CX_SY_CONVERSION_NO_NUMBER"] !== undefined) {
22
+ // @ts-ignore
23
+ throw new abap.Classes["CX_SY_CONVERSION_NO_NUMBER"]();
24
+ }
25
+ else {
26
+ throw "Global class CX_SY_CONVERSION_NO_NUMBER not found";
27
+ }
28
+ }
19
29
  this.value = parseInt(value, 10);
20
30
  }
21
31
  else if (value instanceof float_1.Float) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "1.7.31",
3
+ "version": "1.7.35",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "@types/chai": "^4.3.0",
35
35
  "@types/mocha": "^9.1.0",
36
36
  "@types/sql.js": "^1.4.3",
37
- "chai": "^4.3.5",
37
+ "chai": "^4.3.6",
38
38
  "mocha": "^9.2.0",
39
39
  "source-map-support": "^0.5.21",
40
40
  "typescript": "^4.5.5"