pmcf 6.32.3 → 6.32.4

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/package.json +1 -1
  2. package/src/base.mjs +18 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.32.3",
3
+ "version": "6.32.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -100,22 +100,28 @@ export class Base {
100
100
  }
101
101
 
102
102
  materializeExtends() {
103
- /*
104
- console.log(
105
- "materializeExtends",
106
- this.fullName,
107
- this.owner?.fullName,
108
- [...this.extends].map(n => n.fullName)
109
- );*/
110
-
111
103
  for (const [path, attribute] of extendingAttributeIterator(
112
104
  this.constructor,
113
- attribute =>
114
- attribute.collection &&
115
- !attribute.type.primitive &&
116
- !attribute.deferredExpression
105
+ attribute => attribute.collection && !attribute.type.primitive
117
106
  )) {
107
+ if (attribute.deferredExpression) {
108
+ const name = attribute.name;
109
+ if (!this.hasOwnProperty(name)) {
110
+ for (const e of this.walkDirections(["extends"])) {
111
+ if (e.hasOwnProperty(name)) {
112
+ Object.defineProperty(this, name, {
113
+ get: () => e[name]
114
+ });
115
+ break;
116
+ }
117
+ }
118
+ }
119
+
120
+ continue;
121
+ }
122
+
118
123
  const collection = this[attribute.name];
124
+
119
125
  if (typeof collection?.get === "function") {
120
126
  for (const [name, extending] of this.mapFromDirections(
121
127
  ["extends"],