Fix broken test

pull/4960/head
Billy Levin 5 years ago committed by tanhauhau
parent e4e2372f9f
commit 1cdf3e01ce

@ -62,7 +62,7 @@ export default class Expression {
// discover dependencies, but don't change the code yet // discover dependencies, but don't change the code yet
walk(info, { walk(info, {
enter(node: Node, parent: any, key: string) { enter(node: any, parent: any, key: string) {
// don't manipulate shorthand props twice // don't manipulate shorthand props twice
if (key === 'key' && parent.shorthand) return; if (key === 'key' && parent.shorthand) return;
// don't manipulate `import.meta`, `new.target` // don't manipulate `import.meta`, `new.target`
@ -166,13 +166,13 @@ export default class Expression {
if (declaration) { if (declaration) {
if (declaration.kind === 'const' && !deep) { if (declaration.kind === 'const' && !deep) {
component.error(node as any, { component.error(node, {
code: 'assignment-to-const', code: 'assignment-to-const',
message: 'You are assigning to a const' message: 'You are assigning to a const'
}); });
} }
} else if (variable && variable.writable === false && !deep) { } else if (variable && variable.writable === false && !deep) {
component.error(node as any, { component.error(node, {
code: 'assignment-to-const', code: 'assignment-to-const',
message: 'You are assigning to a const' message: 'You are assigning to a const'
}); });

@ -73,7 +73,7 @@ let world1 = 'world';
let world2 = 'world'; let world2 = 'world';
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
const world3 = 'world'; let world3 = 'world';
function foo() { function foo() {
$$invalidate(0, world3 = 'svelte'); $$invalidate(0, world3 = 'svelte');

@ -1,7 +1,7 @@
<script> <script>
let world1 = 'world'; let world1 = 'world';
let world2 = 'world'; let world2 = 'world';
const world3 = 'world'; let world3 = 'world';
function foo() { function foo() {
world3 = 'svelte'; world3 = 'svelte';
} }

Loading…
Cancel
Save