@abaplint/transpiler 2.11.37 → 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 attr = cdef?.getAttributes().findByName(c.getFirstToken().getStr());
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()) {
@@ -38,10 +38,6 @@ class SelectTranspiler {
38
38
  if (from) {
39
39
  select += new sql_from_1.SQLFromTranspiler().transpile(from, traversal).getCode();
40
40
  }
41
- const groupBy = node.findFirstExpression(abaplint.Expressions.SQLGroupBy);
42
- if (groupBy) {
43
- select += new sql_group_by_1.SQLGroupByTranspiler().transpile(groupBy, traversal).getCode();
44
- }
45
41
  const { table, keys } = this.findTable(node, traversal);
46
42
  let where = undefined;
47
43
  for (const sqlCond of node.findAllExpressions(abaplint.Expressions.SQLCond)) {
@@ -52,6 +48,10 @@ class SelectTranspiler {
52
48
  if (where) {
53
49
  select += "WHERE " + new expressions_1.SQLCondTranspiler().transpile(where, traversal, table).getCode() + " ";
54
50
  }
51
+ const groupBy = node.findFirstExpression(abaplint.Expressions.SQLGroupBy);
52
+ if (groupBy) {
53
+ select += new sql_group_by_1.SQLGroupByTranspiler().transpile(groupBy, traversal).getCode() + " ";
54
+ }
55
55
  const upTo = node.findFirstExpression(abaplint.Expressions.SQLUpTo);
56
56
  if (upTo) {
57
57
  const s = upTo.findFirstExpression(abaplint.Expressions.SimpleSource3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.11.37",
3
+ "version": "2.11.39",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",