diff options
author | Makin <makin@protonmail.com> | 2025-06-18 19:25:16 +0200 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-06-23 06:22:26 -0300 |
commit | 3deef9ebcc27412ef11ca69156c25c5fa252b876 (patch) | |
tree | 03e14936166f9db26ecb73bd735e0860ce1104cd /src/html.js | |
parent | ffd291fe4f06645958fc181c171a5f942ad23f43 (diff) |
prevent validation from running multiple times
Diffstat (limited to 'src/html.js')
-rw-r--r-- | src/html.js | 9 |
1 files changed, 9 insertions, 0 deletions
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`); } |