From d64521cf426737e597315554879fb291ae7513d4 Mon Sep 17 00:00:00 2001 From: Axelen123 Date: Thu, 27 Jun 2019 13:31:49 +0200 Subject: [PATCH] Only capture and inject writable props --- src/compiler/compile/render_dom/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index f1cc3b1443..4274d233eb 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -154,14 +154,14 @@ export default function dom( capture_state = (uses_props || writable_props.length > 0) ? deindent` () => { - return { ${component.vars.map(prop => prop.name).join(", ")} }; + return { ${component.vars.filter(prop => prop.writable).map(prop => prop.name).join(", ")} }; } ` : null; inject_state = (uses_props || writable_props.length > 0) ? deindent` ${$$props} => { ${uses_props && component.invalidate('$$props', `$$props = @assign(@assign({}, $$props), $$new_props)`)} - ${component.vars.map(prop => deindent` + ${component.vars.filter(prop => prop.writable).map(prop => deindent` if ('${prop.name}' in $$props) ${component.invalidate(prop.name, `${prop.name} = ${$$props}.${prop.name}`)}; `)} }