@abaplint/cli 2.120.20 → 2.120.22

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.
Files changed (2) hide show
  1. package/build/cli.js +25 -7
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -16769,11 +16769,12 @@ class ModifyEntities {
16769
16769
  const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
16770
16770
  const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
16771
16771
  const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(operation))));
16772
+ const dynamic = (0, combi_1.seq)("ENTITIES", (0, combi_1.optPrio)((0, combi_1.altPrio)("IN LOCAL MODE", (0, combi_1.seq)((0, combi_1.opt)("FORWARDING"), "PRIVILEGED"))), "OPERATIONS", expressions_1.Source);
16772
16773
  const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith)));
16773
16774
  const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith);
16774
16775
  const create4 = (0, combi_1.seq)("CREATE FROM", expressions_1.Source, (0, combi_1.plus)((0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, "FROM", expressions_1.Source)));
16775
16776
  const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, updateFields, deleteFrom, updateSetFields, updateFrom, create2, create3, create4));
16776
- return (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end), { also: combi_1.AlsoIn.OpenABAP });
16777
+ return (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, dynamic, entity), end), { also: combi_1.AlsoIn.OpenABAP });
16777
16778
  }
16778
16779
  }
16779
16780
  exports.ModifyEntities = ModifyEntities;
@@ -39052,7 +39053,7 @@ class CreateObject {
39052
39053
  this.validateParameters(cdef, node, input);
39053
39054
  }
39054
39055
  static checkInstantiationAllowed(cdef, input) {
39055
- var _a, _b, _c, _d;
39056
+ var _a, _b, _c;
39056
39057
  const createVis = cdef.getCreateVisibility();
39057
39058
  if (createVis === visibility_1.Visibility.Public) {
39058
39059
  return undefined;
@@ -39069,23 +39070,30 @@ class CreateObject {
39069
39070
  input.scope.isLocalFriend(cdef.getName(), enclosingClass)) {
39070
39071
  return undefined;
39071
39072
  }
39073
+ const enclosingDefinition = input.scope.findClassDefinition(enclosingClass);
39074
+ if (enclosingDefinition !== undefined) {
39075
+ const implementedInterfaces = new _object_oriented_1.ObjectOriented(input.scope).findInterfaces(enclosingDefinition);
39076
+ if (cdef.getFriends().some(friend => implementedInterfaces.some(implemented => implemented.name.toUpperCase() === friend.toUpperCase()))) {
39077
+ return undefined;
39078
+ }
39079
+ }
39072
39080
  // subclasses of friends also have friendship
39073
- let enclosingSup = (_a = input.scope.findClassDefinition(enclosingClass)) === null || _a === void 0 ? void 0 : _a.getSuperClass();
39081
+ let enclosingSup = enclosingDefinition === null || enclosingDefinition === void 0 ? void 0 : enclosingDefinition.getSuperClass();
39074
39082
  while (enclosingSup !== undefined) {
39075
39083
  if (cdef.getFriends().some(f => f.toUpperCase() === enclosingSup.toUpperCase()) ||
39076
39084
  input.scope.isLocalFriend(cdef.getName(), enclosingSup)) {
39077
39085
  return undefined;
39078
39086
  }
39079
- enclosingSup = (_b = input.scope.findClassDefinition(enclosingSup)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
39087
+ enclosingSup = (_a = input.scope.findClassDefinition(enclosingSup)) === null || _a === void 0 ? void 0 : _a.getSuperClass();
39080
39088
  }
39081
39089
  if (createVis === visibility_1.Visibility.Protected) {
39082
39090
  // subclasses are also allowed
39083
- let sup = (_c = input.scope.findClassDefinition(enclosingClass)) === null || _c === void 0 ? void 0 : _c.getSuperClass();
39091
+ let sup = (_b = input.scope.findClassDefinition(enclosingClass)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
39084
39092
  while (sup !== undefined) {
39085
39093
  if (sup.toUpperCase() === cdef.getName().toUpperCase()) {
39086
39094
  return undefined;
39087
39095
  }
39088
- sup = (_d = input.scope.findClassDefinition(sup)) === null || _d === void 0 ? void 0 : _d.getSuperClass();
39096
+ sup = (_c = input.scope.findClassDefinition(sup)) === null || _c === void 0 ? void 0 : _c.getSuperClass();
39089
39097
  }
39090
39098
  }
39091
39099
  return cdef.getName() + " cannot be instantiated, class is defined as " +
@@ -51711,6 +51719,7 @@ class ClassDefinition extends _identifier_1.Identifier {
51711
51719
  this.checkInterfaceVisibility(input, node);
51712
51720
  this.checkMethodsFromSuperClasses(input);
51713
51721
  this.checkMethodNameConflicts(input);
51722
+ this.checkEventNameConflicts(input);
51714
51723
  this.checkClassNameLength(input);
51715
51724
  this.checkMethodNameLength(input);
51716
51725
  this.checkClassConstructorStatic(input);
@@ -51850,6 +51859,15 @@ class ClassDefinition extends _identifier_1.Identifier {
51850
51859
  }
51851
51860
  }
51852
51861
  }
51862
+ checkEventNameConflicts(input) {
51863
+ for (const e of this.events) {
51864
+ if (this.attributes.findByName(e.getName()) !== undefined
51865
+ || this.types.getByName(e.getName()) !== undefined
51866
+ || this.methodDefs.getByName(e.getName()) !== undefined) {
51867
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, e.getToken(), `"${e.getName()}" already defined`));
51868
+ }
51869
+ }
51870
+ }
51853
51871
  findFriends(def, input) {
51854
51872
  var _a;
51855
51873
  const result = [];
@@ -69650,7 +69668,7 @@ class Registry {
69650
69668
  }
69651
69669
  static abaplintVersion() {
69652
69670
  // magic, see build script "version.js"
69653
- return "2.120.20";
69671
+ return "2.120.22";
69654
69672
  }
69655
69673
  getDDICReferences() {
69656
69674
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.20",
3
+ "version": "2.120.22",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.20",
42
+ "@abaplint/core": "^2.120.22",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",