From e0defee7f7ab50bf3e6d33d6ab04f6c6795bab27 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 1 Jan 2024 13:29:52 -0400 Subject: infra: statically pre-validate content function slots --- src/content-function.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content-function.js b/src/content-function.js index f57b606a..729211f1 100644 --- a/src/content-function.js +++ b/src/content-function.js @@ -1,3 +1,5 @@ +import {Template} from '#html'; + import { annotateFunction, decorateErrorWithCause, @@ -44,6 +46,10 @@ export default function contentFunction({ throw new ContentFunctionSpecError(`Content functions with slots must specify html in extraDependencies`); } + if (slots) { + Template.validateSlotsDescription(slots); + } + // Pass all the details to expectDependencies, which will recursively build // up a set of fulfilled dependencies and make functions like `relations` // and `generate` callable only with sufficient fulfilled dependencies. -- cgit 1.3.0-6-gf8a5