feat: checking for runes when generating js code for object mutations (#11243)

pull/11250/head
Caique Torres 8 months ago committed by GitHub
parent 669d2d7a1e
commit f632b2a944
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: optimize object property mutations in compilation

@ -105,6 +105,8 @@ export const global_visitors = {
if (serialized_assignment === assignment) { if (serialized_assignment === assignment) {
// No change to output -> nothing to transform -> we can keep the original update expression // No change to output -> nothing to transform -> we can keep the original update expression
return next(); return next();
} else if (context.state.analysis.runes) {
return serialized_assignment;
} else { } else {
/** @type {import('estree').Statement[]} */ /** @type {import('estree').Statement[]} */
let statements; let statements;

Loading…
Cancel
Save