« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/thing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/thing.js')
-rw-r--r--src/data/thing.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/data/thing.js b/src/data/thing.js
index 90453c15..f719224d 100644
--- a/src/data/thing.js
+++ b/src/data/thing.js
@@ -25,6 +25,10 @@ export default class Thing extends CacheableObject {
   static yamlSourceDocument = Symbol.for('Thing.yamlSourceDocument');
   static yamlSourceDocumentPlacement = Symbol.for('Thing.yamlSourceDocumentPlacement');
 
+  [Symbol.for('Thing.yamlSourceFilename')] = null;
+  [Symbol.for('Thing.yamlSourceDocument')] = null;
+  [Symbol.for('Thing.yamlSourceDocumentPlacement')] = null;
+
   static isThingConstructor = Symbol.for('Thing.isThingConstructor');
   static isThing = Symbol.for('Thing.isThing');
 
@@ -33,11 +37,13 @@ export default class Thing extends CacheableObject {
   static [Symbol.for('Thing.isThingConstructor')] = NaN;
 
   constructor() {
-    super();
+    super({seal: false});
 
     // To detect:
     // Object.hasOwn(object, Symbol.for('Thing.isThing'))
     this[Symbol.for('Thing.isThing')] = NaN;
+
+    Object.seal(this);
   }
 
   static [Symbol.for('Thing.selectAll')] = _wikiData => [];
@@ -54,7 +60,7 @@ export default class Thing extends CacheableObject {
       if (this.name) {
         name = colors.green(`"${this.name}"`);
       }
-    } catch (error) {
+    } catch {
       name = colors.yellow(`couldn't get name`);
     }
 
@@ -63,7 +69,7 @@ export default class Thing extends CacheableObject {
       if (this.directory) {
         reference = colors.blue(Thing.getReference(this));
       }
-    } catch (error) {
+    } catch {
       reference = colors.yellow(`couldn't get reference`);
     }