Skip to content

Commit 8ec1c9f

Browse files
committed
regenerate
1 parent 474b3fc commit 8ec1c9f

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

packages/svelte/src/internal/client/errors.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -263,65 +263,65 @@ export function rune_outside_svelte(rune) {
263263
}
264264

265265
/**
266-
* Cannot set prototype of `$state` object
266+
* 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`
267267
* @returns {never}
268268
*/
269-
export function state_prototype_fixed() {
269+
export function state_frozen_invalid_argument() {
270270
if (DEV) {
271-
const error = new Error(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);
271+
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\``);
272272

273273
error.name = 'Svelte error';
274274
throw error;
275275
} else {
276276
// TODO print a link to the documentation
277-
throw new Error("state_prototype_fixed");
277+
throw new Error("state_frozen_invalid_argument");
278278
}
279279
}
280280

281281
/**
282-
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
282+
* Cannot set prototype of `$state` object
283283
* @returns {never}
284284
*/
285-
export function state_unsafe_mutation() {
285+
export function state_prototype_fixed() {
286286
if (DEV) {
287-
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\``);
287+
const error = new Error(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);
288288

289289
error.name = 'Svelte error';
290290
throw error;
291291
} else {
292292
// TODO print a link to the documentation
293-
throw new Error("state_unsafe_mutation");
293+
throw new Error("state_prototype_fixed");
294294
}
295295
}
296296

297297
/**
298-
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
298+
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
299299
* @returns {never}
300300
*/
301-
export function svelte_component_invalid_this_value() {
301+
export function state_unsafe_mutation() {
302302
if (DEV) {
303-
const error = new Error(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);
303+
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\``);
304304

305305
error.name = 'Svelte error';
306306
throw error;
307307
} else {
308308
// TODO print a link to the documentation
309-
throw new Error("svelte_component_invalid_this_value");
309+
throw new Error("state_unsafe_mutation");
310310
}
311311
}
312312

313313
/**
314-
* 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`
314+
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
315315
* @returns {never}
316316
*/
317-
export function state_frozen_invalid_argument() {
317+
export function svelte_component_invalid_this_value() {
318318
if (DEV) {
319-
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\``);
319+
const error = new Error(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);
320320

321321
error.name = 'Svelte error';
322322
throw error;
323323
} else {
324324
// TODO print a link to the documentation
325-
throw new Error("state_frozen_invalid_argument");
325+
throw new Error("svelte_component_invalid_this_value");
326326
}
327327
}

0 commit comments

Comments
 (0)