@abaplint/runtime 2.1.17 → 2.1.20
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.
- package/build/src/statements/cast.js +26 -20
- package/build/src/types/date.d.ts +5 -1
- package/build/src/types/date.js +5 -1
- package/build/src/types/integer.d.ts +5 -1
- package/build/src/types/integer.js +5 -1
- package/build/src/types/string.d.ts +5 -1
- package/build/src/types/string.js +5 -1
- package/build/src/types/time.d.ts +5 -1
- package/build/src/types/time.js +5 -1
- package/build/src/types/utc_long.d.ts +5 -1
- package/build/src/types/utc_long.js +5 -1
- package/build/src/types/xstring.d.ts +5 -1
- package/build/src/types/xstring.js +5 -1
- package/package.json +1 -1
|
@@ -4,33 +4,39 @@ exports.cast = void 0;
|
|
|
4
4
|
const compare_1 = require("../compare");
|
|
5
5
|
// todo, field symbols as input?
|
|
6
6
|
// todo, local classes?
|
|
7
|
+
// check with javascript instanceof?
|
|
8
|
+
// handling interfaces?
|
|
7
9
|
async function cast(target, source) {
|
|
10
|
+
var _a;
|
|
8
11
|
if ((0, compare_1.initial)(source)) {
|
|
9
12
|
target.clear();
|
|
10
13
|
return;
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
// eslint-disable-next-line prefer-const
|
|
16
|
+
let castEnabled = true;
|
|
17
|
+
if (castEnabled === true) {
|
|
18
|
+
const targetName = (_a = target.getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
19
|
+
if ((targetName === null || targetName === void 0 ? void 0 : targetName.startsWith("IF_")) === false
|
|
20
|
+
&& (targetName === null || targetName === void 0 ? void 0 : targetName.startsWith("ZIF_")) === false) { // todo, interfaces are also classes but not inherited
|
|
21
|
+
// using "instanceof" is probably wrong in some cases,
|
|
22
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
if (abap.Classes[targetName] && source.get() instanceof abap.Classes[targetName] === false) {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
if (abap.Classes["CX_SY_MOVE_CAST_ERROR"] !== undefined) {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
throw new abap.Classes["CX_SY_MOVE_CAST_ERROR"]();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw "Global class CX_SY_MOVE_CAST_ERROR not found";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
|
-
|
|
35
|
+
target.set(source);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
target.set(source);
|
|
28
39
|
}
|
|
29
|
-
*/
|
|
30
|
-
// throw cx_sy_move_cast_error if incompatible
|
|
31
|
-
// check with javascript instanceof?
|
|
32
|
-
// handling interfaces?
|
|
33
|
-
target.set(source);
|
|
34
40
|
}
|
|
35
41
|
exports.cast = cast;
|
|
36
42
|
//# sourceMappingURL=cast.js.map
|
|
@@ -4,7 +4,11 @@ import { INumeric } from "./_numeric";
|
|
|
4
4
|
import { String } from "./string";
|
|
5
5
|
export declare class Date implements ICharacter {
|
|
6
6
|
private value;
|
|
7
|
-
|
|
7
|
+
private readonly qualifiedName;
|
|
8
|
+
constructor(input?: {
|
|
9
|
+
qualifiedName?: string;
|
|
10
|
+
});
|
|
11
|
+
getQualifiedName(): string | undefined;
|
|
8
12
|
set(value: INumeric | ICharacter | Hex | string | number): this;
|
|
9
13
|
clear(): void;
|
|
10
14
|
get(): string;
|
package/build/src/types/date.js
CHANGED
|
@@ -6,8 +6,12 @@ const _javascript_date_1 = require("./_javascript_date");
|
|
|
6
6
|
const float_1 = require("./float");
|
|
7
7
|
const _parse_1 = require("../operators/_parse");
|
|
8
8
|
class Date {
|
|
9
|
-
constructor() {
|
|
9
|
+
constructor(input) {
|
|
10
10
|
this.clear();
|
|
11
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
12
|
+
}
|
|
13
|
+
getQualifiedName() {
|
|
14
|
+
return this.qualifiedName;
|
|
11
15
|
}
|
|
12
16
|
set(value) {
|
|
13
17
|
if (typeof value === "number") {
|
|
@@ -4,7 +4,11 @@ import { ICharacter } from "./_character";
|
|
|
4
4
|
import { INumeric } from "./_numeric";
|
|
5
5
|
export declare class Integer implements INumeric {
|
|
6
6
|
private value;
|
|
7
|
-
|
|
7
|
+
private readonly qualifiedName;
|
|
8
|
+
constructor(input?: {
|
|
9
|
+
qualifiedName?: string;
|
|
10
|
+
});
|
|
11
|
+
getQualifiedName(): string | undefined;
|
|
8
12
|
set(value: INumeric | ICharacter | Hex | string | number | Integer | Float): this;
|
|
9
13
|
clear(): void;
|
|
10
14
|
get(): number;
|
|
@@ -5,8 +5,12 @@ const float_1 = require("./float");
|
|
|
5
5
|
const hex_1 = require("./hex");
|
|
6
6
|
const xstring_1 = require("./xstring");
|
|
7
7
|
class Integer {
|
|
8
|
-
constructor() {
|
|
8
|
+
constructor(input) {
|
|
9
9
|
this.value = 0;
|
|
10
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
11
|
+
}
|
|
12
|
+
getQualifiedName() {
|
|
13
|
+
return this.qualifiedName;
|
|
10
14
|
}
|
|
11
15
|
set(value) {
|
|
12
16
|
if (typeof value === "number") {
|
|
@@ -3,7 +3,11 @@ import { ICharacter } from "./_character";
|
|
|
3
3
|
import { INumeric } from "./_numeric";
|
|
4
4
|
export declare class String implements ICharacter {
|
|
5
5
|
private value;
|
|
6
|
-
|
|
6
|
+
private readonly qualifiedName;
|
|
7
|
+
constructor(input?: {
|
|
8
|
+
qualifiedName?: string;
|
|
9
|
+
});
|
|
10
|
+
getQualifiedName(): string | undefined;
|
|
7
11
|
set(value: ICharacter | string | number): this;
|
|
8
12
|
clear(): void;
|
|
9
13
|
get(): string;
|
|
@@ -5,8 +5,12 @@ const _parse_1 = require("../operators/_parse");
|
|
|
5
5
|
const character_1 = require("./character");
|
|
6
6
|
const integer_1 = require("./integer");
|
|
7
7
|
class String {
|
|
8
|
-
constructor() {
|
|
8
|
+
constructor(input) {
|
|
9
9
|
this.value = "";
|
|
10
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
11
|
+
}
|
|
12
|
+
getQualifiedName() {
|
|
13
|
+
return this.qualifiedName;
|
|
10
14
|
}
|
|
11
15
|
set(value) {
|
|
12
16
|
if (typeof value === "string") {
|
|
@@ -4,7 +4,11 @@ import { INumeric } from "./_numeric";
|
|
|
4
4
|
import { String } from "./string";
|
|
5
5
|
export declare class Time implements ICharacter {
|
|
6
6
|
private value;
|
|
7
|
-
|
|
7
|
+
private readonly qualifiedName;
|
|
8
|
+
constructor(input?: {
|
|
9
|
+
qualifiedName?: string;
|
|
10
|
+
});
|
|
11
|
+
getQualifiedName(): string | undefined;
|
|
8
12
|
set(value: INumeric | ICharacter | Hex | string | number): this;
|
|
9
13
|
clear(): void;
|
|
10
14
|
get(): string;
|
package/build/src/types/time.js
CHANGED
|
@@ -5,8 +5,12 @@ const string_1 = require("./string");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const _parse_1 = require("../operators/_parse");
|
|
7
7
|
class Time {
|
|
8
|
-
constructor() {
|
|
8
|
+
constructor(input) {
|
|
9
9
|
this.clear();
|
|
10
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
11
|
+
}
|
|
12
|
+
getQualifiedName() {
|
|
13
|
+
return this.qualifiedName;
|
|
10
14
|
}
|
|
11
15
|
set(value) {
|
|
12
16
|
if (typeof value === "number") {
|
|
@@ -3,7 +3,11 @@ import { ICharacter } from "./_character";
|
|
|
3
3
|
import { INumeric } from "./_numeric";
|
|
4
4
|
export declare class UTCLong implements ICharacter {
|
|
5
5
|
private value;
|
|
6
|
-
|
|
6
|
+
private readonly qualifiedName;
|
|
7
|
+
constructor(input?: {
|
|
8
|
+
qualifiedName?: string;
|
|
9
|
+
});
|
|
10
|
+
getQualifiedName(): string | undefined;
|
|
7
11
|
getOffset(_input: {
|
|
8
12
|
offset?: number | undefined;
|
|
9
13
|
length?: number | undefined;
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UTCLong = void 0;
|
|
4
4
|
class UTCLong {
|
|
5
|
-
constructor() {
|
|
5
|
+
constructor(input) {
|
|
6
6
|
this.clear();
|
|
7
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
8
|
+
}
|
|
9
|
+
getQualifiedName() {
|
|
10
|
+
return this.qualifiedName;
|
|
7
11
|
}
|
|
8
12
|
getOffset(_input) {
|
|
9
13
|
throw new Error("Method not implemented, getOffset(), utcLong");
|
|
@@ -3,7 +3,11 @@ import { ICharacter } from "./_character";
|
|
|
3
3
|
import { INumeric } from "./_numeric";
|
|
4
4
|
export declare class XString implements ICharacter {
|
|
5
5
|
private value;
|
|
6
|
-
|
|
6
|
+
private readonly qualifiedName;
|
|
7
|
+
constructor(input?: {
|
|
8
|
+
qualifiedName?: string;
|
|
9
|
+
});
|
|
10
|
+
getQualifiedName(): string | undefined;
|
|
7
11
|
set(value: ICharacter | INumeric | string): void;
|
|
8
12
|
clear(): void;
|
|
9
13
|
get(): string;
|
|
@@ -3,8 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.XString = void 0;
|
|
4
4
|
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
class XString {
|
|
6
|
-
constructor() {
|
|
6
|
+
constructor(input) {
|
|
7
7
|
this.value = "";
|
|
8
|
+
this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
|
|
9
|
+
}
|
|
10
|
+
getQualifiedName() {
|
|
11
|
+
return this.qualifiedName;
|
|
8
12
|
}
|
|
9
13
|
set(value) {
|
|
10
14
|
if (typeof value === "string") {
|