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

reflect fails on getter on private properties #1040

Closed
sebaplaza opened this issue Jan 16, 2023 · 1 comment · Fixed by #1038
Closed

reflect fails on getter on private properties #1040

sebaplaza opened this issue Jan 16, 2023 · 1 comment · Fixed by #1038

Comments

@sebaplaza
Copy link
Contributor

sebaplaza commented Jan 16, 2023

Hello,

I found a failing case, i made a test to reproduce it:

  it('should return no parameters of a class with private getter properties and no constructor', () => {
    class MyClass {
      #options;

      get options() {
        return this.#options;
      }
    }

    const metadata = reflect(MyClass);
    expect(metadata).toBeDefined();
  });

I'm having this error

TypeError: attempted to get private field on non-instance

Same problem with a class with a constructor and parameters, the getter is the root of the problem.

@ktutnik
Copy link
Collaborator

ktutnik commented Jan 16, 2023

Thank you for structuring the issue.

Please next time just create a new issue if you found one.

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

Successfully merging a pull request may close this issue.

2 participants