Skip to content

Commit f632b2a

Browse files
authored
feat: checking for runes when generating js code for object mutations (#11243)
1 parent 669d2d7 commit f632b2a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/sixty-pandas-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: optimize object property mutations in compilation

packages/svelte/src/compiler/phases/3-transform/client/visitors/global.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export const global_visitors = {
105105
if (serialized_assignment === assignment) {
106106
// No change to output -> nothing to transform -> we can keep the original update expression
107107
return next();
108+
} else if (context.state.analysis.runes) {
109+
return serialized_assignment;
108110
} else {
109111
/** @type {import('estree').Statement[]} */
110112
let statements;

0 commit comments

Comments
 (0)