From 51f2a3b2317738b0146c3276d19dff2000bdddad Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 23 Apr 2019 11:32:37 -0400 Subject: [PATCH 1/2] handle unknown nodes in extract_identifiers (#2510) (#2514) --- src/compile/utils/scope.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/utils/scope.ts b/src/compile/utils/scope.ts index d4427c44ff38..20cca46cba3e 100644 --- a/src/compile/utils/scope.ts +++ b/src/compile/utils/scope.ts @@ -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; } From 356a1eb8d935cbf8e11bf6f6dc7086af6644b531 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 23 Apr 2019 11:39:21 -0400 Subject: [PATCH 2/2] add test --- test/runtime/samples/reactive-value-mutate/_config.js | 3 +++ test/runtime/samples/reactive-value-mutate/main.svelte | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 test/runtime/samples/reactive-value-mutate/_config.js create mode 100644 test/runtime/samples/reactive-value-mutate/main.svelte diff --git a/test/runtime/samples/reactive-value-mutate/_config.js b/test/runtime/samples/reactive-value-mutate/_config.js new file mode 100644 index 000000000000..e40881683408 --- /dev/null +++ b/test/runtime/samples/reactive-value-mutate/_config.js @@ -0,0 +1,3 @@ +export default { + html: `{"bar":42}` +}; diff --git a/test/runtime/samples/reactive-value-mutate/main.svelte b/test/runtime/samples/reactive-value-mutate/main.svelte new file mode 100644 index 000000000000..59fc5b7eb5e1 --- /dev/null +++ b/test/runtime/samples/reactive-value-mutate/main.svelte @@ -0,0 +1,7 @@ + + +{JSON.stringify(foo)}