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

10$: Error on use of this.#something outside of class #219

Closed
strager opened this issue Apr 9, 2021 · 6 comments · Fixed by #383
Closed

10$: Error on use of this.#something outside of class #219

strager opened this issue Apr 9, 2021 · 6 comments · Fixed by #383
Labels
for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html good first issue Good for newcomers and C++ beginners

Comments

@strager
Copy link
Collaborator

strager commented Apr 9, 2021

Private identifiers in dot expressions (e.g. this.#something) are only legal inside of a class. Report an error if such an expression is found outside a class.

@strager strager added the for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html label Apr 9, 2021
@strager strager added the good first issue Good for newcomers and C++ beginners label May 1, 2021
@strager
Copy link
Collaborator Author

strager commented May 1, 2021

I think we'd need to track whether or not we're in a class declaration. We don't do this currently. (We do track whether or not we're in a function or a loop, though; perhaps we could have similar logic for classes.)

@saurabhraj042
Copy link

@strager Can I work on this issue ?

@strager
Copy link
Collaborator Author

strager commented May 20, 2021

@saurabhraj042 Sure!

@singalhimanshu
Copy link
Contributor

@saurabhraj042 Are you still working on it? If not I can work on this issue.

@saurabhraj042
Copy link

@strager @singalhimanshu please give me few more days to work on this , actually I got covid last month and wasn't able to work on this but I have resumed the work for now.

@saurabhraj042 saurabhraj042 removed their assignment Jul 5, 2021
@singalhimanshu
Copy link
Contributor

@strager I would like to work on this task.

strager pushed a commit that referenced this issue Jul 10, 2021
The following code:

    this.#x;

Should report `error_cannot_access_private_identifier_outside_class`.

Fix: #219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for hire Get paid for working on this task: https://quick-lint-js.com/hiring.html good first issue Good for newcomers and C++ beginners
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants