From 3deef9ebcc27412ef11ca69156c25c5fa252b876 Mon Sep 17 00:00:00 2001 From: Makin Date: Wed, 18 Jun 2025 19:25:16 +0200 Subject: prevent validation from running multiple times --- src/html.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/html.js') diff --git a/src/html.js b/src/html.js index 71b6f4d5..097ecfee 100644 --- a/src/html.js +++ b/src/html.js @@ -53,6 +53,11 @@ export const attributeSpec = { }, }; +// Validation keeps running even after we validate +// all of data, this let us turn it off and let build run free +let VALIDATION_DISABLED = false; +export function finishValidation() { VALIDATION_DISABLED = true; } + // Pass to tag() as an attributes key to make tag() return a 8lank tag if the // provided content is empty. Useful for when you'll only 8e showing an element // according to the presence of content that would 8elong there. @@ -1773,6 +1778,10 @@ export class Template { } static validateSlotValueAgainstDescription(value, description) { + if (VALIDATION_DISABLED) { + return true; + } + if (value === undefined) { throw new TypeError(`Specify value as null or don't specify at all`); } -- cgit 1.3.0-6-gf8a5