@abaplint/transpiler 2.13.44 → 2.13.46
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.
|
@@ -94,7 +94,12 @@ class SourceTranspiler {
|
|
|
94
94
|
ret = new chunk_1.Chunk().appendString("(").appendChunk(ret).appendString(").dereference()");
|
|
95
95
|
}
|
|
96
96
|
else if (c.get() instanceof core_1.Expressions.TextElement) {
|
|
97
|
-
|
|
97
|
+
const key = c.findFirstExpression(core_1.Expressions.TextElementKey)?.concatTokens().toUpperCase();
|
|
98
|
+
const textSymbol = key === undefined
|
|
99
|
+
? undefined
|
|
100
|
+
: traversal.getCurrentObject().getTextSymbols()[key]?.entry;
|
|
101
|
+
const value = textSymbol ?? c.concatTokens();
|
|
102
|
+
ret = new chunk_1.Chunk().appendString(`new abap.types.String().set(${JSON.stringify(value)})`);
|
|
98
103
|
}
|
|
99
104
|
else if (c.get() instanceof core_1.Expressions.TypeNameOrInfer) {
|
|
100
105
|
continue;
|
package/build/src/traversal.js
CHANGED
|
@@ -482,10 +482,15 @@ class Traversal {
|
|
|
482
482
|
}
|
|
483
483
|
buildThisAttributes(def, cName) {
|
|
484
484
|
let ret = "";
|
|
485
|
+
const constants = def.getAttributes()?.getConstants() || [];
|
|
485
486
|
for (const a of def.getAttributes()?.getAll() || []) {
|
|
486
487
|
let escaped = Traversal.escapeNamespace(a.getName().toLowerCase());
|
|
487
488
|
if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
|
|
488
489
|
ret += "this." + escaped + " = " + cName + "." + escaped + ";\n";
|
|
490
|
+
const isConstant = constants.some(c => c.getName().toUpperCase() === a.getName().toUpperCase());
|
|
491
|
+
if (a.getVisibility() === abaplint.Visibility.Private && isConstant === false) {
|
|
492
|
+
ret += `this.FRIENDS_ACCESS_INSTANCE["${escaped}"] = this.${escaped};\n`;
|
|
493
|
+
}
|
|
489
494
|
}
|
|
490
495
|
else {
|
|
491
496
|
if (a.getVisibility() === abaplint.Visibility.Private) {
|