From bd58ecd5a73e1cc67b73e3fcb664011a02c06087 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 22 Feb 2025 13:36:38 -0400 Subject: cacheable-object: don't hit superclass finalized status Also report errors finalizing properly --- src/data/cacheable-object.js | 2 +- src/data/things/index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/cacheable-object.js b/src/data/cacheable-object.js index 4b354ef7..087f7825 100644 --- a/src/data/cacheable-object.js +++ b/src/data/cacheable-object.js @@ -37,7 +37,7 @@ export default class CacheableObject { } static finalizeCacheableObjectPrototype() { - if (this[CacheableObject.constructorFinalized]) { + if (Object.hasOwn(this, CacheableObject.constructorFinalized)) { throw new Error(`Constructor ${this.name} already finalized`); } diff --git a/src/data/things/index.js b/src/data/things/index.js index 309d0803..d0eb5aa7 100644 --- a/src/data/things/index.js +++ b/src/data/things/index.js @@ -186,6 +186,10 @@ function finalizeCacheableObjectPrototypes() { op(constructor) { constructor.finalizeCacheableObjectPrototype(); }, + + showFailedClasses(failedClasses) { + logError`Failed to finalize cacheable object prototypes for classes: ${failedClasses.join(', ')}`; + }, }); } -- cgit 1.3.0-6-gf8a5