Skip to content

Commit 989803d

Browse files
committed
tentative fix for macros broken by $capture_state
1 parent f305354 commit 989803d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/compile/render_dom/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ export default function dom(
170170
const capturable_vars = component.vars.filter(v => !v.internal && !v.global && !v.name.startsWith('$$'));
171171

172172
if (capturable_vars.length > 0) {
173-
capture_state = x`() => ({ ${capturable_vars.map(prop => p`${prop.name}`)} })`;
173+
capture_state = x`() => ({ ${
174+
capturable_vars.map(prop => `'${prop.name.replace("'", "\\'")}': ${prop.name}`).join(', ')
175+
} })`;
174176
}
175177

176178
const injectable_vars = capturable_vars.filter(v => !v.module && v.writable && v.name[0] !== '$');

0 commit comments

Comments
 (0)