From 929e8500667012b2b2f5506efbfd10a39134a9cd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 22 Feb 2025 11:26:27 -0400 Subject: yaml, find-reverse: don't double-count inherited specs --- src/data/yaml.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/data/yaml.js') diff --git a/src/data/yaml.js b/src/data/yaml.js index ee65eb7f..69069d66 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -695,10 +695,17 @@ export function getAllDataSteps() { const steps = []; + const seenLoadingFns = new Set(); + for (const thingConstructor of Object.values(thingConstructors)) { const getSpecFn = thingConstructor[Thing.getYamlLoadingSpec]; if (!getSpecFn) continue; + // Subclasses can expose literally the same static properties + // by inheritence. We don't want to double-count those! + if (seenLoadingFns.has(getSpecFn)) continue; + seenLoadingFns.add(getSpecFn); + steps.push(getSpecFn({ documentModes, thingConstructors, -- cgit 1.3.0-6-gf8a5