@abaplint/runtime 2.7.102 → 2.7.104
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.
|
@@ -96,6 +96,8 @@ class Character {
|
|
|
96
96
|
length = (0, _parse_1.parse)(length);
|
|
97
97
|
}
|
|
98
98
|
if ((offset && offset >= this.length)
|
|
99
|
+
|| (length && length > this.length)
|
|
100
|
+
|| (offset && length && offset + length > this.length)
|
|
99
101
|
|| (offset && offset < 0)
|
|
100
102
|
|| (length && length < 0)) {
|
|
101
103
|
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
package/build/src/types/hex.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.Hex = void 0;
|
|
|
4
4
|
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
const float_1 = require("./float");
|
|
6
6
|
const xstring_1 = require("./xstring");
|
|
7
|
+
const throw_error_1 = require("../throw_error");
|
|
7
8
|
class Hex {
|
|
8
9
|
constructor(input) {
|
|
9
10
|
this.length = (input === null || input === void 0 ? void 0 : input.length) ? input === null || input === void 0 ? void 0 : input.length : 1;
|
|
@@ -62,20 +63,29 @@ class Hex {
|
|
|
62
63
|
return this.value;
|
|
63
64
|
}
|
|
64
65
|
getOffset(input) {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
let offset = input === null || input === void 0 ? void 0 : input.offset;
|
|
67
|
+
if (offset) {
|
|
68
|
+
offset = (0, _parse_1.parse)(offset);
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
let length = input === null || input === void 0 ? void 0 : input.length;
|
|
71
|
+
if (length) {
|
|
72
|
+
length = (0, _parse_1.parse)(length);
|
|
73
|
+
}
|
|
74
|
+
if ((offset && offset * 2 > this.value.length)
|
|
75
|
+
|| (length && length * 2 > this.value.length)
|
|
76
|
+
|| (offset && length && offset * 2 + length * 2 > this.value.length)
|
|
77
|
+
|| (offset && offset < 0)
|
|
78
|
+
|| (length && length < 0)) {
|
|
79
|
+
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
70
80
|
}
|
|
71
81
|
let ret = this.value;
|
|
72
|
-
if (
|
|
82
|
+
if (offset) {
|
|
73
83
|
// @ts-ignore
|
|
74
|
-
ret = ret.substr(
|
|
84
|
+
ret = ret.substr(offset * 2);
|
|
75
85
|
}
|
|
76
|
-
if (
|
|
86
|
+
if (length !== undefined) {
|
|
77
87
|
// @ts-ignore
|
|
78
|
-
ret = ret.substr(0,
|
|
88
|
+
ret = ret.substr(0, length * 2);
|
|
79
89
|
}
|
|
80
90
|
const r = new xstring_1.XString();
|
|
81
91
|
r.set(ret);
|
package/build/src/types/numc.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Numc = void 0;
|
|
4
4
|
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
const throw_error_1 = require("../throw_error");
|
|
6
|
+
const float_1 = require("./float");
|
|
6
7
|
class Numc {
|
|
7
8
|
constructor(input) {
|
|
8
9
|
this.length = (input === null || input === void 0 ? void 0 : input.length) ? input === null || input === void 0 ? void 0 : input.length : 1;
|
|
@@ -14,11 +15,14 @@ class Numc {
|
|
|
14
15
|
}
|
|
15
16
|
set(value, raw = false) {
|
|
16
17
|
if (typeof value === "number") {
|
|
17
|
-
this.value =
|
|
18
|
+
this.value = Math.trunc(value) + "";
|
|
18
19
|
}
|
|
19
20
|
else if (typeof value === "string") {
|
|
20
21
|
this.value = parseInt(value, 10) + "";
|
|
21
22
|
}
|
|
23
|
+
else if (value instanceof float_1.Float) {
|
|
24
|
+
this.value = Math.trunc(value.getRaw()) + "";
|
|
25
|
+
}
|
|
22
26
|
else {
|
|
23
27
|
this.set(value.get());
|
|
24
28
|
return;
|
|
@@ -72,6 +72,8 @@ class String {
|
|
|
72
72
|
length = (0, _parse_1.parse)(length);
|
|
73
73
|
}
|
|
74
74
|
if ((offset && offset > this.value.length)
|
|
75
|
+
|| (length && length > this.value.length)
|
|
76
|
+
|| (offset && length && offset + length > this.value.length)
|
|
75
77
|
|| (offset && offset < 0)
|
|
76
78
|
|| (length && length < 0)) {
|
|
77
79
|
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
@@ -4,6 +4,7 @@ exports.XString = void 0;
|
|
|
4
4
|
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
const float_1 = require("./float");
|
|
6
6
|
const character_1 = require("./character");
|
|
7
|
+
const throw_error_1 = require("../throw_error");
|
|
7
8
|
class XString {
|
|
8
9
|
constructor(input) {
|
|
9
10
|
this.value = "";
|
|
@@ -51,20 +52,29 @@ class XString {
|
|
|
51
52
|
return this.value;
|
|
52
53
|
}
|
|
53
54
|
getOffset(input) {
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
let offset = input === null || input === void 0 ? void 0 : input.offset;
|
|
56
|
+
if (offset) {
|
|
57
|
+
offset = (0, _parse_1.parse)(offset);
|
|
56
58
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
let length = input === null || input === void 0 ? void 0 : input.length;
|
|
60
|
+
if (length) {
|
|
61
|
+
length = (0, _parse_1.parse)(length);
|
|
62
|
+
}
|
|
63
|
+
if ((offset && offset * 2 > this.value.length)
|
|
64
|
+
|| (length && length * 2 > this.value.length)
|
|
65
|
+
|| (offset && length && offset * 2 + length * 2 > this.value.length)
|
|
66
|
+
|| (offset && offset < 0)
|
|
67
|
+
|| (length && length < 0)) {
|
|
68
|
+
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
59
69
|
}
|
|
60
70
|
let ret = this.value;
|
|
61
|
-
if (
|
|
71
|
+
if (offset) {
|
|
62
72
|
// @ts-ignore
|
|
63
|
-
ret = ret.substr(
|
|
73
|
+
ret = ret.substr(offset * 2);
|
|
64
74
|
}
|
|
65
|
-
if (
|
|
75
|
+
if (length !== undefined) {
|
|
66
76
|
// @ts-ignore
|
|
67
|
-
ret = ret.substr(0,
|
|
77
|
+
ret = ret.substr(0, length * 2);
|
|
68
78
|
}
|
|
69
79
|
const r = new XString();
|
|
70
80
|
r.set(ret);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.104",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "abaplint",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/chai": "^4.3.
|
|
32
|
+
"@types/chai": "^4.3.7",
|
|
33
33
|
"@types/mocha": "^10.0.2",
|
|
34
34
|
"chai": "^4.3.10",
|
|
35
35
|
"mocha": "^10.2.0",
|