pmcf 4.25.2 → 4.25.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.25.2",
3
+ "version": "4.25.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -194,7 +194,6 @@ export class Base {
194
194
  forOwner(owner) {
195
195
  if (this.owner !== owner) {
196
196
  const newObject = Object.create(this);
197
- newObject.extends = new Set([...this.extends]);
198
197
  newObject.owner = owner;
199
198
  return newObject;
200
199
  }
@@ -18,28 +18,24 @@ export class InitializationContext {
18
18
  }
19
19
 
20
20
  resolveOutstanding() {
21
- for (let { object, attribute, name, value } of this.outstandingResolves) {
21
+ nextOutstanding: for (let { object, attribute, name, value } of this
22
+ .outstandingResolves) {
22
23
  value = object.expand(value);
23
24
 
24
25
  for (const type of attribute.type.members || [attribute.type]) {
25
- const o =
26
- object.typeNamed(type.name, value) ||
27
- object.owner.typeNamed(type.name, value) ||
28
- object.root.typeNamed(type.name, value); // TODO
29
-
30
- if (o) {
31
- this.assign(object, name, attribute, o);
32
-
33
- // console.log("RESOLVE", object.fullName,name,o.fullName);
34
- // continue;
26
+ for (const node of object.walkDirections(["this", "owner"])) {
27
+ const resolved = node.typeNamed(type.name, value);
28
+ if (resolved) {
29
+ this.assign(object, name, attribute, resolved);
30
+ continue nextOutstanding;
31
+ }
35
32
  }
36
33
  }
37
34
 
38
- /*
39
35
  this.error(
40
- `No such object "${value}" (${attribute.type.name}) for attribute ${name}`,
36
+ `Unable to resolve "${value}" (${attribute.type.name}) for attribute ${name}`,
41
37
  object.root.named(value)?.toString()
42
- );*/
38
+ );
43
39
  }
44
40
  }
45
41
 
@@ -85,6 +81,9 @@ export class InitializationContext {
85
81
  if (value instanceof Set) {
86
82
  object[name] = current.union(value);
87
83
  } else {
84
+ /*if(name === 'extends') {
85
+ console.log("EXT",object.fullName,value.fullName)
86
+ }*/
88
87
  object[name].add(value);
89
88
  }
90
89
  } else if (current instanceof Map) {
@@ -30,10 +30,8 @@ export class ServiceOwner extends Base {
30
30
  const present = this._services.get(service.name);
31
31
 
32
32
  if (present) {
33
- //console.log("LINK SERVICE", this.fullName, present.fullName, service.fullName);
34
33
  present.extends.add(service);
35
34
  } else {
36
- //console.log("ADD SERVICE", this.fullName, service.fullName);
37
35
  this.services = service.forOwner(this);
38
36
  }
39
37
  }