Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5: Assigning this to variable exposes signals #11476

Closed
mjadobson opened this issue May 5, 2024 · 0 comments
Closed

Svelte 5: Assigning this to variable exposes signals #11476

mjadobson opened this issue May 5, 2024 · 0 comments

Comments

@mjadobson
Copy link

Describe the bug

<script>
  class A {
    #b = $state(0)
    c() {
      let self = this;
      return self.#b;
    }
  }

  let a = new A();
  console.log(a.c()); // {"f":0,"reactions":null,"v":0,"version":0,"inspect":{}}
</script>

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAEz2OzQrCMBCEX2VZPSRQqudqhV496MGj8RDjVgMxluxWkdJ3l_h3mWG-YWAGbH0gxmo_YLRXwgqbrsMC5dnlwHcKQlgg3_rkMlmyS76TlYlGXLDM0MCQg5HJEWqYslghNdcf5pT-1UYCCTCFFmqQi-fFjyeSPsV3VU6OXzxme0ueWagh0gMapRcmLmf_F8N6t92ULMnHs2-fypZOaT1igdfbybeeTlhJ6mk8jC_-4PxX7QAAAA==

Logs

No response

System Info

Svelte 5.0.0-next.123

Severity

annoyance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant