fix: correct typo in compiler error messages (#14044)

pull/14031/head
Rich Harris 6 days ago committed by GitHub
parent 224fcde821
commit 4157db94c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: replace typo in compiler error messages

@ -119,7 +119,7 @@ Can only bind to state or props
### block_invalid_continuation_placement
```
{:...} block is invalid at this position (did you forget to close the preceeding element or block?)
{:...} block is invalid at this position (did you forget to close the preceding element or block?)
```
### block_invalid_elseif

@ -74,7 +74,7 @@
## block_invalid_continuation_placement
> {:...} block is invalid at this position (did you forget to close the preceeding element or block?)
> {:...} block is invalid at this position (did you forget to close the preceding element or block?)
## block_invalid_elseif

@ -747,12 +747,12 @@ export function block_duplicate_clause(node, name) {
}
/**
* {:...} block is invalid at this position (did you forget to close the preceeding element or block?)
* {:...} block is invalid at this position (did you forget to close the preceding element or block?)
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function block_invalid_continuation_placement(node) {
e(node, "block_invalid_continuation_placement", "{:...} block is invalid at this position (did you forget to close the preceeding element or block?)");
e(node, "block_invalid_continuation_placement", "{:...} block is invalid at this position (did you forget to close the preceding element or block?)");
}
/**

@ -48,7 +48,7 @@ export function render_stylesheet(source, analysis, options) {
code.remove(0, ast.content.start);
code.remove(/** @type {number} */ (ast.content.end), source.length);
if (state.minify) {
remove_preceeding_whitespace(ast.content.end, state);
remove_preceding_whitespace(ast.content.end, state);
}
const css = {
@ -122,7 +122,7 @@ const visitors = {
index++;
}
} else if (state.minify) {
remove_preceeding_whitespace(node.start, state);
remove_preceding_whitespace(node.start, state);
// Don't minify whitespace in custom properties, since some browsers (Chromium < 99)
// treat --foo: ; and --foo:; differently
@ -136,8 +136,8 @@ const visitors = {
},
Rule(node, { state, next, visit }) {
if (state.minify) {
remove_preceeding_whitespace(node.start, state);
remove_preceeding_whitespace(node.block.end - 1, state);
remove_preceding_whitespace(node.start, state);
remove_preceding_whitespace(node.block.end - 1, state);
}
// keep empty rules in dev, because it's convenient to
@ -385,7 +385,7 @@ const visitors = {
* @param {number} end
* @param {State} state
*/
function remove_preceeding_whitespace(end, state) {
function remove_preceding_whitespace(end, state) {
let start = end;
while (/\s/.test(state.code.original[start - 1])) start--;
if (start < end) state.code.remove(start, end);

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [1, 1]
}
});

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [6, 6]
}
});

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [18, 18]
}
});

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [17, 17]
}
});

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [21, 21]
}
});

@ -4,7 +4,7 @@ export default test({
error: {
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
'{:...} block is invalid at this position (did you forget to close the preceding element or block?)',
position: [1, 1]
}
});

@ -6,7 +6,7 @@
// no semicolon at the end
$: time_8 = count * 8
$: ({ time_16 } = { time_16: count * 16 })
// preceeding let that doesn't do anything
// preceding let that doesn't do anything
let time_32;
$: time_32 = count * doubled;
let very_high;

@ -6,11 +6,11 @@
// no semicolon at the end
let time_8 = $derived(count * 8)
let { time_16 } = $derived({ time_16: count * 16 })
// preceeding let that doesn't do anything
// preceding let that doesn't do anything
let time_32 = $derived(count * doubled);
let very_high = $derived(time_32 * count);
</script>
{count} / {doubled} / {quadrupled} / {time_8} / {time_16}
{count} / {doubled} / {quadrupled} / {time_8} / {time_16}

Loading…
Cancel
Save