@abaplint/runtime 2.10.33 → 2.10.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ICharacter } from "./types/_character";
|
|
2
|
-
export declare function dynamicCallLookup(obj: any, methodName: ICharacter): any;
|
|
2
|
+
export declare function dynamicCallLookup(obj: any, methodName: string | ICharacter): any;
|
|
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.dynamicCallLookup = dynamicCallLookup;
|
|
4
4
|
function dynamicCallLookup(obj, methodName) {
|
|
5
5
|
// todo: escape interface and namespace characters in name?
|
|
6
|
-
const name = methodName.get().toLowerCase().trimEnd();
|
|
6
|
+
const name = typeof methodName === "string" ? methodName : methodName.get().toLowerCase().trimEnd();
|
|
7
7
|
let ret = obj[name];
|
|
8
|
-
if (ret
|
|
8
|
+
if (ret !== undefined) {
|
|
9
|
+
ret = ret.bind(obj);
|
|
10
|
+
}
|
|
11
|
+
else if (obj.FRIENDS_ACCESS_INSTANCE !== undefined) {
|
|
9
12
|
// it might be private, note this currently does not respect encapsulation properly
|
|
13
|
+
// FRIENDS_ACCESS_INSTANCE is already .bind()'ed
|
|
10
14
|
ret = obj.FRIENDS_ACCESS_INSTANCE[name];
|
|
11
15
|
}
|
|
12
16
|
if (ret === undefined) {
|