mobx-keystone 2.4.2 → 2.4.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
|
@@ -329,12 +329,20 @@ export function sharedInternalModel<
|
|
|
329
329
|
// Copy static props from the base without reading its lazy snapshot processor
|
|
330
330
|
// accessors. This keeps subclass declaration from compiling the parent model's
|
|
331
331
|
// processor graph before snapshot processing is actually needed.
|
|
332
|
+
// Props are defined rather than assigned, since assigning fails for keys that are
|
|
333
|
+
// non-writable on Function.prototype (e.g. Symbol.metadata, added by standard
|
|
334
|
+
// decorators).
|
|
332
335
|
for (const key of Reflect.ownKeys(base)) {
|
|
333
336
|
if (key === "fromSnapshotProcessor" || key === "toSnapshotProcessor") {
|
|
334
337
|
continue
|
|
335
338
|
}
|
|
336
339
|
if (Object.prototype.propertyIsEnumerable.call(base, key)) {
|
|
337
|
-
|
|
340
|
+
Object.defineProperty(ThisModel, key, {
|
|
341
|
+
value: (base as any)[key],
|
|
342
|
+
writable: true,
|
|
343
|
+
enumerable: true,
|
|
344
|
+
configurable: true,
|
|
345
|
+
})
|
|
338
346
|
}
|
|
339
347
|
}
|
|
340
348
|
delete (ThisModel as any)[modelUnwrappedClassSymbol]
|