fix: don't override instance methods during legacy class creation (#10834)

fixes #10805
pull/10842/head
Simon H 1 year ago committed by GitHub
parent f8c85d525d
commit 1fc41730a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: don't override instance methods during legacy class creation

@ -79,6 +79,7 @@ class Svelte4Component {
});
for (const key of Object.keys(this.#instance)) {
if (key === '$set' || key === '$destroy' || key === '$on') continue;
define_property(this, key, {
get() {
return this.#instance[key];

Loading…
Cancel
Save