Skip to content

Commit

Permalink
Merge pull request #2518 from sveltejs/gh-2510
Browse files Browse the repository at this point in the history
 handle unknown nodes in extract_identifiers
  • Loading branch information
Rich-Harris authored Apr 25, 2019
2 parents b111785 + 356a1eb commit c97ee00
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/utils/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function extract_names(param: Node) {

export function extract_identifiers(param: Node) {
const nodes: Node[] = [];
extractors[param.type](nodes, param);
extractors[param.type] && extractors[param.type](nodes, param);
return nodes;
}

Expand Down
3 changes: 3 additions & 0 deletions test/runtime/samples/reactive-value-mutate/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
html: `{"bar":42}`
};
7 changes: 7 additions & 0 deletions test/runtime/samples/reactive-value-mutate/main.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
let foo = {};
let bar = 42;
$: foo.bar = bar;
</script>

{JSON.stringify(foo)}

0 comments on commit c97ee00

Please sign in to comment.