cheeky hack to keep treeshakeability until we can nuke this validation altogether

pull/12521/head
Rich Harris 2 years ago
parent b35af5249d
commit 52e6fa8437

@ -2,6 +2,22 @@
import { DEV } from 'esm-env';
/**
* Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead
* @returns {never}
*/
export function invalid_default_snippet() {
if (DEV) {
const error = new Error(`invalid_default_snippet\nCannot use \`{@render children(...)}\` if the parent component uses \`let:\` directives. Consider using a named snippet instead`);
error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("invalid_default_snippet");
}
}
/**
* `%name%(...)` can only be used during component initialisation
* @param {string} name
@ -82,20 +98,4 @@ export function svelte_element_invalid_this_value() {
// TODO print a link to the documentation
throw new Error("svelte_element_invalid_this_value");
}
}
/**
* Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead
* @returns {never}
*/
export function invalid_default_snippet() {
if (DEV) {
const error = new Error(`invalid_default_snippet\nCannot use \`{@render children(...)}\` if the parent component uses \`let:\` directives. Consider using a named snippet instead`);
error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("invalid_default_snippet");
}
}

@ -12,6 +12,7 @@ export const invalid_default_snippet = add_snippet_symbol(e.invalid_default_snip
* @param {any} fn
* @returns {import('svelte').Snippet}
*/
/*@__NO_SIDE_EFFECTS__*/
export function add_snippet_symbol(fn) {
fn[snippet_symbol] = true;
return fn;

Loading…
Cancel
Save