@abaplint/transpiler 2.11.38 → 2.11.39
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.
|
@@ -43,9 +43,14 @@ class FieldChainTranspiler {
|
|
|
43
43
|
let name = c.getFirstToken().getStr().toLowerCase();
|
|
44
44
|
if (context instanceof abaplint.BasicTypes.ObjectReferenceType) {
|
|
45
45
|
const cdef = traversal.findClassDefinition(context.getIdentifierName(), scope);
|
|
46
|
-
const
|
|
46
|
+
const tokenName = c.getFirstToken().getStr();
|
|
47
|
+
const attr = cdef?.getAttributes().findByName(tokenName);
|
|
48
|
+
// Do not mark constants as private JS fields. Constants are exposed on instances via constructor copying.
|
|
49
|
+
const constants = cdef?.getAttributes().getConstants() || [];
|
|
50
|
+
const isConstant = constants.some(cons => cons.getName().toUpperCase() === tokenName.toUpperCase());
|
|
47
51
|
if (feature_flags_1.FEATURE_FLAGS.PRIVATE_ATTRIBUTES === true
|
|
48
|
-
&& attr?.getVisibility() === abaplint.Visibility.Private
|
|
52
|
+
&& attr?.getVisibility() === abaplint.Visibility.Private
|
|
53
|
+
&& isConstant === false) {
|
|
49
54
|
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
50
55
|
if (id?.stype === abaplint.ScopeType.ClassImplementation
|
|
51
56
|
&& cdef?.getName().toUpperCase() === id.sname.toUpperCase()) {
|