fix: prevent migration script from adding `props.` to the `export let` identifier (#13899)

pull/13888/head
Paolo Ricciuti 2 months ago committed by GitHub
parent 3147287813
commit b63fde3b75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: prevent migration script from adding `props.` to the `export let` identifier

@ -1514,7 +1514,7 @@ function handle_identifier(node, state, path) {
); );
} else { } else {
const binding = state.scope.get(node.name); const binding = state.scope.get(node.name);
if (binding?.kind === 'bindable_prop') { if (binding?.kind === 'bindable_prop' && binding.node !== node) {
state.str.prependLeft(/** @type {number} */ (node.start), `${state.names.props}.`); state.str.prependLeft(/** @type {number} */ (node.start), `${state.names.props}.`);
} }
} }

@ -0,0 +1,5 @@
<script>
export let stuff;
console.log($$props);
</script>

@ -0,0 +1,5 @@
<script>
let { ...props } = $props();
console.log(props);
</script>
Loading…
Cancel
Save