@abaplint/runtime 2.10.29 → 2.10.31
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamicCallLookup = dynamicCallLookup;
|
|
4
|
+
function dynamicCallLookup(obj, methodName) {
|
|
5
|
+
// todo: escape interface and namespace characters in name?
|
|
6
|
+
const name = methodName.get().toLowerCase().trimEnd();
|
|
7
|
+
let ret = obj[name];
|
|
8
|
+
if (ret === undefined) {
|
|
9
|
+
// it might be private, note this currently does not respect encapsulation properly
|
|
10
|
+
ret = obj.FRIENDS_ACCESS_INSTANCE[name];
|
|
11
|
+
}
|
|
12
|
+
if (ret === undefined) {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'] === undefined) {
|
|
15
|
+
throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found";
|
|
16
|
+
}
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD']();
|
|
19
|
+
}
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=dynamic_call_lookup.js.map
|
package/build/src/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Console } from "./console/console";
|
|
|
16
16
|
import { MemoryConsole } from "./console/memory_console";
|
|
17
17
|
import { buildDbTableName } from "./prefix";
|
|
18
18
|
import { IntegerFactory } from "./integer_factory";
|
|
19
|
+
import { dynamicCallLookup } from "./dynamic_call_lookup";
|
|
19
20
|
export { UnitTestResult, RFC, types, DB, MemoryConsole };
|
|
20
21
|
export type RuntimeDatabaseOptions = {
|
|
21
22
|
schemaPrefix?: string;
|
|
@@ -67,6 +68,7 @@ export declare class ABAP {
|
|
|
67
68
|
buildDbTableName: typeof buildDbTableName;
|
|
68
69
|
ClassicError: typeof ClassicError;
|
|
69
70
|
IntegerFactory: typeof IntegerFactory;
|
|
71
|
+
dynamicCallLookup: typeof dynamicCallLookup;
|
|
70
72
|
readonly context: Context;
|
|
71
73
|
readonly dbo: RuntimeDatabaseOptions;
|
|
72
74
|
constructor(input?: RuntimeOptions);
|
package/build/src/index.js
CHANGED
|
@@ -24,6 +24,7 @@ const memory_console_1 = require("./console/memory_console");
|
|
|
24
24
|
Object.defineProperty(exports, "MemoryConsole", { enumerable: true, get: function () { return memory_console_1.MemoryConsole; } });
|
|
25
25
|
const prefix_1 = require("./prefix");
|
|
26
26
|
const integer_factory_1 = require("./integer_factory");
|
|
27
|
+
const dynamic_call_lookup_1 = require("./dynamic_call_lookup");
|
|
27
28
|
class ABAP {
|
|
28
29
|
constructor(input) {
|
|
29
30
|
// global objects
|
|
@@ -48,6 +49,7 @@ class ABAP {
|
|
|
48
49
|
this.buildDbTableName = prefix_1.buildDbTableName;
|
|
49
50
|
this.ClassicError = classic_error_1.ClassicError;
|
|
50
51
|
this.IntegerFactory = integer_factory_1.IntegerFactory;
|
|
52
|
+
this.dynamicCallLookup = dynamic_call_lookup_1.dynamicCallLookup;
|
|
51
53
|
this.context = new context_1.Context();
|
|
52
54
|
this.console = input?.console ? input?.console : new standard_out_console_1.StandardOutConsole();
|
|
53
55
|
this.context.console = this.console;
|