fix: account for mutations in script module in ownership check ()

pull/14260/head
Paolo Ricciuti 5 months ago committed by GitHub
parent 7bc94b9984
commit ae9f53a3bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: account for mutations in script module in ownership check

@ -59,6 +59,9 @@ export function get_component() {
}
for (const module of modules) {
if (module.end == null) {
return null;
}
if (module.start.line < entry.line && module.end.line > entry.line) {
return module.component;
}

@ -0,0 +1,7 @@
import { test } from '../../test';
export default test({
compileOptions: {
dev: true
}
});

@ -0,0 +1,6 @@
<script module>
let obj = $state({});
obj.test = "hi!";
</script>
<h1>Values: {JSON.stringify(obj)}</h1>
Loading…
Cancel
Save