update some compiler error messages

pull/6413/head
Conduitry 5 years ago committed by tanhauhau
parent 9b52dcbbbf
commit 72a548950c

@ -248,7 +248,7 @@ export default {
}, },
invalid_const_placement: { invalid_const_placement: {
code: 'invalid-const-placement', code: 'invalid-const-placement',
message: '{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>' message: '{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>'
}, },
invalid_const_declaration: (name: string) => ({ invalid_const_declaration: (name: string) => ({
code: 'invalid-const-declaration', code: 'invalid-const-declaration',
@ -256,10 +256,10 @@ export default {
}), }),
invalid_const_update: (name: string) => ({ invalid_const_update: (name: string) => ({
code: 'invalid-const-update', code: 'invalid-const-update',
message: `'${name}' is declared using {@const ...} and it is read-only` message: `'${name}' is declared using {@const ...} and is read-only`
}), }),
cyclical_constant_tags: (cycle: string[]) => ({ cyclical_const_tags: (cycle: string[]) => ({
code: 'cyclical-constant-tags', code: 'cyclical-const-tags',
message: `Cyclical dependency detected: ${cycle.join(' → ')}` message: `Cyclical dependency detected: ${cycle.join(' → ')}`
}) })
}; };

@ -68,7 +68,7 @@ function sort_consts_nodes(consts_nodes: ConstTag[], component: Component) {
if (cycle && cycle.length) { if (cycle && cycle.length) {
const nodeList = lookup.get(cycle[0]); const nodeList = lookup.get(cycle[0]);
const node = nodeList[0]; const node = nodeList[0];
component.error(node.node, compiler_errors.cyclical_constant_tags(cycle)); component.error(node.node, compiler_errors.cyclical_const_tags(cycle));
} }
const add_node = (node: ConstNode) => { const add_node = (node: ConstNode) => {

@ -1,6 +1,6 @@
[ [
{ {
"code": "cyclical-constant-tags", "code": "cyclical-const-tags",
"message": "Cyclical dependency detected: b → c → b", "message": "Cyclical dependency detected: b → c → b",
"start": { "line": 6, "column": 2, "character": 61 }, "start": { "line": 6, "column": 2, "character": 61 },
"end": { "line": 6, "column": 20, "character": 79 }, "end": { "line": 6, "column": 20, "character": 79 },

@ -1,7 +1,7 @@
[ [
{ {
"code": "invalid-const-placement", "code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>", "message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 5, "column": 0, "character": 36 }, "start": { "line": 5, "column": 0, "character": 36 },
"end": { "line": 5, "column": 18, "character": 54 }, "end": { "line": 5, "column": 18, "character": 54 },
"pos": 36 "pos": 36

@ -1,7 +1,7 @@
[ [
{ {
"code": "invalid-const-placement", "code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>", "message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 6, "column": 2, "character": 46 }, "start": { "line": 6, "column": 2, "character": 46 },
"end": { "line": 6, "column": 20, "character": 64 }, "end": { "line": 6, "column": 20, "character": 64 },
"pos": 46 "pos": 46

@ -1,7 +1,7 @@
[ [
{ {
"code": "invalid-const-placement", "code": "invalid-const-placement",
"message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> and <Component>", "message": "{@const} must be the immediate child of {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>",
"start": { "line": 7, "column": 4, "character": 63 }, "start": { "line": 7, "column": 4, "character": 63 },
"end": { "line": 7, "column": 18, "character": 77 }, "end": { "line": 7, "column": 18, "character": 77 },
"pos": 63 "pos": 63

@ -1,7 +1,7 @@
[ [
{ {
"code": "invalid-const-update", "code": "invalid-const-update",
"message": "'b' is declared using {@const ...} and it is read-only", "message": "'b' is declared using {@const ...} and is read-only",
"start": { "line": 7, "column": 26, "character": 106 }, "start": { "line": 7, "column": 26, "character": 106 },
"end": { "line": 7, "column": 30, "character": 110 }, "end": { "line": 7, "column": 30, "character": 110 },
"pos": 106 "pos": 106

Loading…
Cancel
Save