fix some tests

pull/11294/head
Rich Harris 2 years ago
parent 689ba3085c
commit 21eaa08017

@ -44,7 +44,7 @@ Invalid selector
## invalid_css_identifier ## invalid_css_identifier
TODO Expected a valid CSS identifier
## invalid_nesting_selector ## invalid_nesting_selector
@ -52,4 +52,4 @@ Nesting selectors can only be used inside a rule
## invalid_css_declaration ## invalid_css_declaration
TODO TODO

@ -1,6 +1,6 @@
## unclosed_element ## unclosed_element
%name% was left open `<%name%>` was left open
## unclosed_block ## unclosed_block

@ -56,11 +56,11 @@ Cannot export derived state from a module. To expose the current derived value,
## invalid_assignment ## invalid_assignment
Cannot assign to `%thing%` Cannot assign to %thing%
## invalid_binding ## invalid_binding
Cannot bind to `%thing%` Cannot bind to %thing%
## invalid_rune_args ## invalid_rune_args

@ -418,7 +418,7 @@ export function invalid_css_selector(node) {
* @returns {never} * @returns {never}
*/ */
export function invalid_css_identifier(node) { export function invalid_css_identifier(node) {
e(node, "invalid_css_identifier", "TODO"); e(node, "invalid_css_identifier", "Expected a valid CSS identifier");
} }
/** /**
@ -518,7 +518,7 @@ export function cyclical_reactive_declaration(node, cycle) {
* @returns {never} * @returns {never}
*/ */
export function unclosed_element(node, name) { export function unclosed_element(node, name) {
e(node, "unclosed_element", `${name} was left open`); e(node, "unclosed_element", `\`<${name}>\` was left open`);
} }
/** /**
@ -981,7 +981,7 @@ export function invalid_host_location(node) {
* @returns {never} * @returns {never}
*/ */
export function invalid_assignment(node, thing) { export function invalid_assignment(node, thing) {
e(node, "invalid_assignment", `Cannot assign to \`${thing}\``); e(node, "invalid_assignment", `Cannot assign to ${thing}`);
} }
/** /**
@ -990,7 +990,7 @@ export function invalid_assignment(node, thing) {
* @returns {never} * @returns {never}
*/ */
export function invalid_binding(node, thing) { export function invalid_binding(node, thing) {
e(node, "invalid_binding", `Cannot bind to \`${thing}\``); e(node, "invalid_binding", `Cannot bind to ${thing}`);
} }
/** /**

@ -92,7 +92,7 @@ export class Parser {
if (current.type === 'RegularElement') { if (current.type === 'RegularElement') {
current.end = current.start + 1; current.end = current.start + 1;
e.unclosed_element(current, `<${current.name}>`); e.unclosed_element(current, current.name);
} else { } else {
current.end = current.start + 1; current.end = current.start + 1;
e.unclosed_block(current); e.unclosed_block(current);

@ -677,7 +677,7 @@ function read_attribute_value(parser) {
'in attribute value' 'in attribute value'
); );
} catch (/** @type {any} */ error) { } catch (/** @type {any} */ error) {
if (error.code === 'js-parse-error') { if (error.code === 'js_parse_error') {
// if the attribute value didn't close + self-closing tag // if the attribute value didn't close + self-closing tag
// eg: `<Component test={{a:1} />` // eg: `<Component test={{a:1} />`
// acorn may throw a `Unterminated regular expression` because of `/>` // acorn may throw a `Unterminated regular expression` because of `/>`
@ -687,7 +687,7 @@ function read_attribute_value(parser) {
e.unclosed_attribute_value(pos, quote_mark || '}'); e.unclosed_attribute_value(pos, quote_mark || '}');
} }
} }
throw e; throw error;
} }
if (value.length === 0 && !quote_mark) { if (value.length === 0 && !quote_mark) {

@ -1023,10 +1023,13 @@ function validate_no_const_assignment(node, argument, scope, is_binding) {
// (binding.kind !== 'normal' || !binding.initial) // (binding.kind !== 'normal' || !binding.initial)
// ); // );
// TODO have a more specific error message for assignments to things like `{:then foo}`
const thing = 'constant';
if (is_binding) { if (is_binding) {
e.invalid_binding(node, 'TODO'); e.invalid_binding(node, thing);
} else { } else {
e.invalid_assignment(node, 'TODO'); e.invalid_assignment(node, thing);
} }
} }
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'missing-attribute-value', code: 'missing_attribute_value',
message: 'Expected attribute value', message: 'Expected attribute value',
position: [12, 12] position: [12, 12]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-sequence-expression', code: 'invalid_sequence_expression',
message: message:
'Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses', 'Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses',
position: [124, 131] position: [124, 131]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-sequence-expression', code: 'invalid_sequence_expression',
message: message:
'Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses', 'Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses',
position: [163, 170] position: [163, 170]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-attribute', code: 'duplicate_attribute',
message: 'Attributes need to be unique', message: 'Attributes need to be unique',
position: [17, 17] position: [17, 17]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-attribute', code: 'duplicate_attribute',
message: 'Attributes need to be unique', message: 'Attributes need to be unique',
position: [17, 17] position: [17, 17]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-attribute', code: 'duplicate_attribute',
message: 'Attributes need to be unique', message: 'Attributes need to be unique',
position: [17, 17] position: [17, 17]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'expected-token', code: 'expected_token',
message: 'Expected token {:else}', message: 'Expected token {:else}',
position: [35, 35] position: [35, 35]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-continuing-block-placement', code: 'invalid_continuing_block_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 preceeding element or block?)',
position: [1, 1] position: [1, 1]

@ -2,8 +2,9 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-location', code: 'invalid_state_location',
message: '$state(...) can only be used as a variable declaration initializer or a class field', message:
'`$state(...)` can only be used as a variable declaration initializer or a class field',
position: [33, 41] position: [33, 41]
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'unexpected-eof', code: 'expected_token',
message: 'Unexpected end of input (expected -->)', message: 'Expected token -->',
position: [24, 24] position: [24, 24]
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-slot-name', code: 'duplicate_slot_name',
message: "Duplicate slot name 'foo' in <Nested>" message: "Duplicate slot name 'foo' in <Nested>"
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-slot-name', code: 'duplicate_slot_name',
message: "Duplicate slot name 'foo' in <Nested>" message: "Duplicate slot name 'foo' in <Nested>"
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-default-slot-content', code: 'invalid_default_slot_content',
message: 'Found default slot content alongside an explicit slot="default"' message: 'Found default slot content alongside an explicit slot="default"'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-slot-name', code: 'duplicate_slot_name',
message: "Duplicate slot name 'foo' in <Nested>" message: "Duplicate slot name 'foo' in <Nested>"
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-slot-name', code: 'duplicate_slot_name',
message: "Duplicate slot name 'foo' in <Nested>" message: "Duplicate slot name 'foo' in <Nested>"
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-slot-name', code: 'duplicate_slot_name',
message: "Duplicate slot name 'foo' in <Nested>" message: "Duplicate slot name 'foo' in <Nested>"
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-slot-placement', code: 'invalid_slot_placement',
message: message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element" "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-slot-placement', code: 'invalid_slot_placement',
message: message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element" "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-slot-placement', code: 'invalid_slot_placement',
message: message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element" "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-global-block-combinator', code: 'invalid_css_global_block_combinator',
message: 'A :global {...} block cannot follow a > combinator', message: 'A :global {...} block cannot follow a > combinator',
position: [12, 21] position: [12, 21]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-global-block-declaration', code: 'invalid_css_global_block_declaration',
message: 'A :global {...} block can only contain rules, not declarations', message: 'A :global {...} block can only contain rules, not declarations',
position: [24, 34] position: [24, 34]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-global-block-modifier', code: 'invalid_css_global_block_modifier',
message: 'A :global {...} block cannot modify an existing selector', message: 'A :global {...} block cannot modify an existing selector',
position: [14, 21] position: [14, 21]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-global-block-list', code: 'invalid_css_global_block_list',
message: 'A :global {...} block cannot be part of a selector list with more than one item', message: 'A :global {...} block cannot be part of a selector list with more than one item',
position: [9, 31] position: [9, 31]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-identifier', code: 'invalid_css_identifier',
message: 'Expected a valid CSS identifier', message: 'Expected a valid CSS identifier',
position: [25, 25] position: [25, 25]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-dollar-binding', code: 'invalid_dollar_binding',
message: 'The $ name is reserved, and cannot be used for variables and imports' message: 'The $ name is reserved, and cannot be used for variables and imports'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-global', code: 'illegal_global',
message: message:
'$ is an illegal variable name. To reference a global variable called $, use globalThis.$' '`$` is an illegal variable name. To reference a global variable called `$`, use `globalThis.$`'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-global', code: 'illegal_global',
message: message:
'$ is an illegal variable name. To reference a global variable called $, use globalThis.$' '`$` is an illegal variable name. To reference a global variable called `$`, use `globalThis.$`'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-dollar-binding', code: 'invalid_dollar_binding',
message: 'The $ name is reserved, and cannot be used for variables and imports' message: 'The $ name is reserved, and cannot be used for variables and imports'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-binding', code: 'bind_invalid_target',
message: "'value' binding can only be used with <input>, <textarea>, <select>" message: '`bind:value` can only be used with <input>, <textarea>, <select>'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'expected-token', code: 'expected_token',
message: 'Expected token {:then ...} or {:catch ...}', message: 'Expected token {:then ...} or {:catch ...}',
position: [24, 24] position: [24, 24]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-continuing-block-placement', code: 'invalid_continuing_block_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 preceeding element or block?)',
position: [6, 6] position: [6, 6]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-continuing-block-placement', code: 'invalid_continuing_block_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 preceeding element or block?)',
position: [18, 18] position: [18, 18]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-continuing-block-placement', code: 'invalid_continuing_block_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 preceeding element or block?)',
position: [17, 17] position: [17, 17]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'expected-token', code: 'expected_token',
message: 'Expected token {:then ...} or {:catch ...}', message: 'Expected token {:then ...} or {:catch ...}',
position: [26, 26] position: [26, 26]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'expected-token', code: 'expected_token',
message: 'Expected token {:then ...} or {:catch ...}', message: 'Expected token {:then ...} or {:catch ...}',
position: [27, 27] position: [27, 27]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'empty-attribute-shorthand', code: 'empty_attribute_shorthand',
message: 'Attribute shorthand cannot be empty', message: 'Attribute shorthand cannot be empty',
position: [6, 6] position: [6, 6]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'empty-directive-name', code: 'empty_directive_name',
message: 'ClassDirective name cannot be empty', message: 'ClassDirective name cannot be empty',
position: [10, 10] position: [10, 10]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'empty-directive-name', code: 'empty_directive_name',
message: 'UseDirective name cannot be empty', message: 'UseDirective name cannot be empty',
position: [8, 8] position: [8, 8]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-export', code: 'invalid_derived_export',
message: message:
'Cannot export derived state from a module. To expose the current derived value, export a function returning its value', 'Cannot export derived state from a module. To expose the current derived value, export a function returning its value',
position: [24, 66] position: [24, 66]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-export', code: 'invalid_state_export',
message: message:
"Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties", "Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties",
position: [76, 114] position: [76, 114]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-export', code: 'invalid_state_export',
message: message:
"Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties", "Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties",
position: [46, 86] position: [46, 86]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'js-parse-error', code: 'js_parse_error',
message: 'Assigning to rvalue', message: 'Assigning to rvalue',
position: [1, 1] position: [1, 1]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-snippet-assignment', code: 'invalid_snippet_assignment',
message: 'Cannot reassign or bind to snippet parameter' message: 'Cannot reassign or bind to snippet parameter'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-snippet-assignment', code: 'invalid_snippet_assignment',
message: 'Cannot reassign or bind to snippet parameter' message: 'Cannot reassign or bind to snippet parameter'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-const-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to const variable' message: 'Cannot assign to constant'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-const-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to const variable' message: 'Cannot assign to constant'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-style-element', code: 'duplicate_style_element',
message: 'A component can have a single top-level <style> element', message: 'A component can have a single top-level `<style>` element',
position: [58, 58] position: [58, 58]
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-element-content', code: 'invalid_element_content',
message: '<svelte:options> cannot have children', message: '<svelte:options> cannot have children',
position: [16, 16] position: [16, 16]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'missing-whitespace', code: 'missing_whitespace',
message: 'Expected whitespace', message: 'Expected whitespace',
position: [6, 6] position: [6, 6]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-render-call', code: 'invalid_render_call',
message: 'Calling a snippet function using apply, bind or call is not allowed' message: 'Calling a snippet function using apply, bind or call is not allowed'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-runes-mode-import', code: 'invalid_runes_mode_import',
message: 'beforeUpdate cannot be used in runes mode' message: 'beforeUpdate cannot be used in runes mode'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'duplicate-props-rune', code: 'duplicate_props_rune',
message: 'Cannot use $props() more than once' message: 'Cannot use `$props()` more than once'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-legacy-export', code: 'invalid_legacy_export',
message: 'Cannot use `export let` in runes mode — use $props instead' message: 'Cannot use `export let` in runes mode — use $props instead'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-export', code: 'invalid_state_export',
message: message:
"Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties", "Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties",
position: [28, 53] position: [28, 53]

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-each-assignment', code: 'invalid_each_assignment',
message: message:
"Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. 'array[i] = value' instead of 'entry = value')" 'Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. `array[i] = value` instead of `entry = value`)'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-each-assignment', code: 'invalid_each_assignment',
message: message:
"Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. 'array[i] = value' instead of 'entry = value')" 'Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. `array[i] = value` instead of `entry = value`)'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-const-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to const variable' message: 'Cannot assign to constant'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-const-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to const variable' message: 'Cannot assign to constant'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to derived state' message: 'Cannot assign to derived state'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-binding', code: 'invalid_binding',
message: 'Invalid binding to derived state' message: 'Cannot bind to derived state'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to derived state' message: 'Cannot assign to derived state'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to derived state' message: 'Cannot assign to derived state'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-derived-assignment', code: 'invalid_assignment',
message: 'Invalid assignment to derived state' message: 'Cannot assign to derived state'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-location', code: 'invalid_state_location',
message: '$state(...) can only be used as a variable declaration initializer or a class field' message: '`$state(...)` can only be used as a variable declaration initializer or a class field'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'conflicting-property-name', code: 'conflicting_property_name',
message: 'Cannot have a property and a component export with the same name' message: 'Cannot have a property and a component export with the same name'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args_length',
message: '$bindable can only be called with 0 or 1 arguments' message: '`$bindable` must be called with zero or one arguments'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-bindable-location', code: 'invalid_bindable_location',
message: '$bindable() can only be used inside a $props() declaration' message: '`$bindable()` can only be used inside a `$props()` declaration'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args_length',
message: '$derived can only be called with 1 argument' message: '`$derived` must be called with exactly one argument'
} }
}); });

@ -2,7 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-location', code: 'invalid_state_location',
message: '$derived(...) can only be used as a variable declaration initializer or a class field' message:
'`$derived(...)` can only be used as a variable declaration initializer or a class field'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args_length',
message: '$effect can only be called with 1 argument' message: '`$effect` must be called with exactly one argument'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-effect-location', code: 'invalid_effect_location',
message: '$effect() can only be used as an expression statement' message: '`$effect()` can only be used as an expression statement'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-host-location', code: 'invalid_host_location',
message: '$host() can only be used inside custom element component instances' message: '`$host()` can only be used inside custom element component instances'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args',
message: '$props can only be called with 0 arguments' message: '`$props` cannot be called with arguments'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-props-location', code: 'invalid_props_location',
message: message:
'$props() can only be used at the top level of components as a variable declaration initializer' '`$props()` can only be used at the top level of components as a variable declaration initializer'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args_length',
message: '$state can only be called with 0 or 1 arguments' message: '`$state` must be called with zero or one arguments'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-state-location', code: 'invalid_state_location',
message: '$state(...) can only be used as a variable declaration initializer or a class field' message: '`$state(...)` can only be used as a variable declaration initializer or a class field'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-rune-args-length', code: 'invalid_rune_args_length',
message: '$state.snapshot can only be called with 1 argument' message: '`$state.snapshot` must be called with exactly one argument'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'unexpected-eof', code: 'unexpected_eof',
message: 'Unexpected end of input', message: 'Unexpected end of input',
position: [32, 32] position: [32, 32]
} }

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'unclosed-element', code: 'unclosed_element',
message: '<script> was left open', message: '`<script>` was left open',
position: [32, 32] position: [32, 32]
} }
}); });

@ -2,9 +2,9 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-self-placement', code: 'invalid_self_placement',
message: message:
'<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, {#snippet} blocks or slots passed to components', '`<svelte:self>` components can only exist inside {#if} blocks, {#each} blocks, {#snippet} blocks or slots passed to components',
position: [1, 1] position: [1, 1]
} }
}); });

@ -2,9 +2,9 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'conflicting-slot-usage', code: 'conflicting_slot_usage',
message: message:
'Cannot use <slot> syntax and {@render ...} tags in the same component. Migrate towards {@render ...} tags completely.', 'Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely.',
position: [71, 84] position: [71, 84]
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'conflicting-children-snippet', code: 'conflicting_children_snippet',
message: message:
'Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block', 'Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block',
position: [320, 353] position: [320, 353]

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-subscription', code: 'illegal_subscription',
message: 'Cannot reference store value inside <script context="module">', message: 'Cannot reference store value inside `<script context="module">`',
position: [164, 168] position: [164, 168]
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-store-subscription', code: 'illegal_store_subscription',
message: 'Cannot subscribe to stores that are not declared at the top level of the component' message: 'Cannot subscribe to stores that are not declared at the top level of the component'
} }
}); });

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-global', code: 'illegal_global',
message: message:
'$foo is an illegal variable name. To reference a global variable called $foo, use globalThis.$foo' '`$foo` is an illegal variable name. To reference a global variable called `$foo`, use `globalThis.$foo`'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-dollar-prefix', code: 'invalid_dollar_prefix',
message: 'The $ prefix is reserved, and cannot be used for variables and imports' message: 'The $ prefix is reserved, and cannot be used for variables and imports'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-store-subscription', code: 'illegal_store_subscription',
message: 'Cannot subscribe to stores that are not declared at the top level of the component', message: 'Cannot subscribe to stores that are not declared at the top level of the component',
position: [142, 147] position: [142, 147]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-store-subscription', code: 'illegal_store_subscription',
message: 'Cannot subscribe to stores that are not declared at the top level of the component', message: 'Cannot subscribe to stores that are not declared at the top level of the component',
position: [167, 172] position: [167, 172]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-store-subscription', code: 'illegal_store_subscription',
message: 'Cannot subscribe to stores that are not declared at the top level of the component' message: 'Cannot subscribe to stores that are not declared at the top level of the component'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'illegal-store-subscription', code: 'illegal_store_subscription',
message: 'Cannot subscribe to stores that are not declared at the top level of the component' message: 'Cannot subscribe to stores that are not declared at the top level of the component'
} }
}); });

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'expected-token', code: 'expected_token',
message: 'Expected token </style', message: 'Expected token </style',
position: [31, 31] position: [31, 31]
} }

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-css-identifier', code: 'invalid_css_identifier',
message: 'Expected a valid CSS identifier', message: 'Expected a valid CSS identifier',
position: [9, 9] position: [9, 9]
} }

@ -2,9 +2,9 @@ import { test } from '../../test';
export default test({ export default test({
error: { error: {
code: 'invalid-svelte-tag', code: 'invalid_svelte_tag',
message: message:
'Valid <svelte:...> tag names are svelte:head, svelte:options, svelte:window, svelte:document, svelte:body, svelte:element, svelte:component, svelte:self or svelte:fragment', 'Valid `<svelte:...>` tag names are svelte:head, svelte:options, svelte:window, svelte:document, svelte:body, svelte:element, svelte:component, svelte:self or svelte:fragment',
position: [10, 10] position: [10, 10]
} }
}); });

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save