fix: always validate snippets if custom renderer is enabled

fix-interleaving
paoloricciuti 3 months ago committed by GitHub
parent a1bf283aca
commit 879d544abb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,10 +45,14 @@ export function RenderTag(node, context) {
); );
if (node.metadata.dynamic) { if (node.metadata.dynamic) {
// In custom renderer components, validate that the snippet is compatible // In custom-renderer-aware builds, validate that the snippet is compatible
// with the current renderer before rendering it // with the current renderer before rendering it.
if (custom_renderer) { if (custom_renderer !== undefined) {
snippet_function = b.call('$.validate_snippet_renderer', b.id('$renderer'), snippet_function); snippet_function = b.call(
'$.validate_snippet_renderer',
custom_renderer ? b.id('$renderer') : b.literal(null),
snippet_function
);
} }
// If we have a chain expression then ensure a nullish snippet function gets turned into an empty one // If we have a chain expression then ensure a nullish snippet function gets turned into an empty one
@ -64,10 +68,14 @@ export function RenderTag(node, context) {
) )
); );
} else { } else {
// In custom renderer components, validate that the snippet is compatible // In custom-renderer-aware builds, validate that the snippet is compatible
// with the current renderer before rendering it // with the current renderer before rendering it.
if (custom_renderer) { if (custom_renderer !== undefined) {
snippet_function = b.call('$.validate_snippet_renderer', b.id('$renderer'), snippet_function); snippet_function = b.call(
'$.validate_snippet_renderer',
custom_renderer ? b.id('$renderer') : b.literal(null),
snippet_function
);
} }
statements.push( statements.push(

Loading…
Cancel
Save