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

pull/14031/head
Rich Harris 10 months 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_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 ### block_invalid_elseif

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

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [1, 1]
} }
}); });

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [6, 6]
} }
}); });

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [18, 18]
} }
}); });

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [17, 17]
} }
}); });

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [21, 21]
} }
}); });

@ -4,7 +4,7 @@ export default test({
error: { error: {
code: 'block_invalid_continuation_placement', code: 'block_invalid_continuation_placement',
message: 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] position: [1, 1]
} }
}); });

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

@ -6,7 +6,7 @@
// no semicolon at the end // no semicolon at the end
let time_8 = $derived(count * 8) let time_8 = $derived(count * 8)
let { time_16 } = $derived({ time_16: count * 16 }) 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 time_32 = $derived(count * doubled);
let very_high = $derived(time_32 * count); let very_high = $derived(time_32 * count);

Loading…
Cancel
Save