Skip to content

Commit c0150b0

Browse files
authored
chore: tweak readonly error message (#9816)
* tweak readonly error message * update tests --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 1e4af19 commit c0150b0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/svelte/src/internal/client/proxy/readonly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function readonly(value) {
4242
*/
4343
const readonly_error = (_, prop) => {
4444
throw new Error(
45-
`Props cannot be mutated, unless used with \`bind:\`. Use \`bind:prop-in-question={..}\` to make \`${prop}\` settable. Fallback values can never be mutated.`
45+
`Non-bound props cannot be mutated — use \`bind:<prop>={...}\` to make \`${prop}\` settable. Fallback values can never be mutated.`
4646
);
4747
};
4848

packages/svelte/tests/runtime-runes/samples/proxy-prop-default-readonly/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export default test({
1515
},
1616

1717
runtime_error:
18-
'Props cannot be mutated, unless used with `bind:`. Use `bind:prop-in-question={..}` to make `count` settable. Fallback values can never be mutated.'
18+
'Non-bound props cannot be mutated — use `bind:<prop>={...}` to make `count` settable. Fallback values can never be mutated.'
1919
});

packages/svelte/tests/runtime-runes/samples/proxy-prop-readonly/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export default test({
1515
},
1616

1717
runtime_error:
18-
'Props cannot be mutated, unless used with `bind:`. Use `bind:prop-in-question={..}` to make `count` settable. Fallback values can never be mutated.'
18+
'Non-bound props cannot be mutated — use `bind:<prop>={...}` to make `count` settable. Fallback values can never be mutated.'
1919
});

0 commit comments

Comments
 (0)