fix: `validate_snippet_arguments`

pull/18058/head
paoloricciuti 4 months ago
parent 1886dc9aab
commit c322fdff25

@ -1,11 +1,11 @@
import { renderer } from '../custom-renderer/state.js';
import * as e from '../errors.js';
/**
* @param {Node} anchor
* @param {...(()=>any)[]} args
*/
export function validate_snippet_args(anchor, ...args) {
// TODO RENDERER: don't emit validate args for custom renderers
if (typeof anchor !== 'object' || !(anchor instanceof Node)) {
if (!renderer && (typeof anchor !== 'object' || !(anchor instanceof Node))) {
e.invalid_snippet_arguments();
}

@ -0,0 +1,8 @@
import { test } from '../../test';
export default test({
compileOptions: {
dev: true
},
html: 'world'
});

@ -0,0 +1,5 @@
{#snippet greet(name)}
{name}
{/snippet}
{@render greet("world")}
Loading…
Cancel
Save