@abaplint/transpiler 2.10.72 → 2.10.74
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.
|
@@ -37,16 +37,25 @@ class TargetTranspiler {
|
|
|
37
37
|
}
|
|
38
38
|
else if (c.get() instanceof core_1.Expressions.AttributeName) {
|
|
39
39
|
let prefix = "";
|
|
40
|
+
let postfix = "";
|
|
40
41
|
if (context instanceof abaplint.BasicTypes.ObjectReferenceType) {
|
|
41
42
|
const cdef = traversal.findClassDefinition(context.getIdentifierName(), scope);
|
|
42
43
|
const attr = cdef?.getAttributes().findByName(c.getFirstToken().getStr());
|
|
43
44
|
if (feature_flags_1.FEATURE_FLAGS.PRIVATE_ATTRIBUTES === true
|
|
44
45
|
&& attr?.getVisibility() === abaplint.Visibility.Private) {
|
|
45
|
-
|
|
46
|
+
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
47
|
+
if (id?.stype === abaplint.ScopeType.ClassImplementation
|
|
48
|
+
&& cdef?.getName().toUpperCase() === id.sname.toUpperCase()) {
|
|
49
|
+
prefix = "#";
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
prefix = `FRIENDS_ACCESS_INSTANCE["`;
|
|
53
|
+
postfix = `"]`;
|
|
54
|
+
}
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
const intf = traversal_1.Traversal.escapeNamespace(traversal.isInterfaceAttribute(c.getFirstToken()));
|
|
49
|
-
let name = prefix + traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr()).replace("~", "$").toLowerCase();
|
|
58
|
+
let name = prefix + traversal_1.Traversal.escapeNamespace(c.getFirstToken().getStr()).replace("~", "$").toLowerCase() + postfix;
|
|
50
59
|
if (intf && name.startsWith(intf) === false) {
|
|
51
60
|
name = intf + "$" + name;
|
|
52
61
|
}
|
package/build/src/traversal.js
CHANGED
|
@@ -434,10 +434,8 @@ class Traversal {
|
|
|
434
434
|
if (method.getVisibility() === abaplint.Visibility.Private) {
|
|
435
435
|
privateHash = "#";
|
|
436
436
|
}
|
|
437
|
-
else {
|
|
438
|
-
continue;
|
|
439
|
-
}
|
|
440
437
|
const methodName = privateHash + Traversal.escapeNamespace(name.replace("~", "$"));
|
|
438
|
+
// NOTE: currently all are needed in the unit test setup
|
|
441
439
|
ret += `"${name.replace("~", "$")}": this.${methodName}.bind(this),\n`;
|
|
442
440
|
}
|
|
443
441
|
/*
|