Skip to content

Commit

Permalink
regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jul 12, 2024
1 parent 474b3fc commit 8ec1c9f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/svelte/src/internal/client/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,65 +263,65 @@ export function rune_outside_svelte(rune) {
}

/**
* Cannot set prototype of `$state` object
* The argument to `$state.frozen(...)` cannot be an object created with `$state(...)`. You should create a copy of it first, for example with `$state.snapshot`
* @returns {never}
*/
export function state_prototype_fixed() {
export function state_frozen_invalid_argument() {
if (DEV) {
const error = new Error(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);
const error = new Error(`state_frozen_invalid_argument\nThe argument to \`$state.frozen(...)\` cannot be an object created with \`$state(...)\`. You should create a copy of it first, for example with \`$state.snapshot\``);

error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("state_prototype_fixed");
throw new Error("state_frozen_invalid_argument");
}
}

/**
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
* Cannot set prototype of `$state` object
* @returns {never}
*/
export function state_unsafe_mutation() {
export function state_prototype_fixed() {
if (DEV) {
const error = new Error(`state_unsafe_mutation\nUpdating state inside a derived is forbidden. If the value should not be reactive, declare it without \`$state\``);
const error = new Error(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);

error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("state_unsafe_mutation");
throw new Error("state_prototype_fixed");
}
}

/**
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
* @returns {never}
*/
export function svelte_component_invalid_this_value() {
export function state_unsafe_mutation() {
if (DEV) {
const error = new Error(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);
const error = new Error(`state_unsafe_mutation\nUpdating state inside a derived is forbidden. If the value should not be reactive, declare it without \`$state\``);

error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("svelte_component_invalid_this_value");
throw new Error("state_unsafe_mutation");
}
}

/**
* The argument to `$state.frozen(...)` cannot be an object created with `$state(...)`. You should create a copy of it first, for example with `$state.snapshot`
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
* @returns {never}
*/
export function state_frozen_invalid_argument() {
export function svelte_component_invalid_this_value() {
if (DEV) {
const error = new Error(`state_frozen_invalid_argument\nThe argument to \`$state.frozen(...)\` cannot be an object created with \`$state(...)\`. You should create a copy of it first, for example with \`$state.snapshot\``);
const error = new Error(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);

error.name = 'Svelte error';
throw error;
} else {
// TODO print a link to the documentation
throw new Error("state_frozen_invalid_argument");
throw new Error("svelte_component_invalid_this_value");
}
}

0 comments on commit 8ec1c9f

Please sign in to comment.