fix: include method definitions in class private fields (#14365)

* fix: include method definitions in class private fields

* Update packages/svelte/tests/runtime-runes/samples/class-disabinguate-private-method-definition/_config.js

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/14368/head
Paolo Ricciuti 1 month ago committed by GitHub
parent ce471310c4
commit 32a1453805
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: include method definitions in class private fields

@ -28,7 +28,7 @@ export function ClassBody(node, context) {
for (const definition of node.body) {
if (
definition.type === 'PropertyDefinition' &&
(definition.type === 'PropertyDefinition' || definition.type === 'MethodDefinition') &&
(definition.key.type === 'Identifier' ||
definition.key.type === 'PrivateIdentifier' ||
definition.key.type === 'Literal')

@ -0,0 +1,8 @@
<script>
class Repo {
tree = $state();
async #tree() {
}
}
const repo = new Repo();
</script>
Loading…
Cancel
Save