Skip to content

Checker no mangle #9

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

Closed

Conversation

mheiber
Copy link

@mheiber mheiber commented Sep 3, 2018

checker changes for private names

compare with the symbol-table-key-mangling solution in a separate PR

  • treat private names as unique:
    • case 1: cannot say that a variable is of a class type unless the variable points to an instance of the class
      • see test
      • solution implemented:
        • When appending a declaration to a symbol, if the declaration name is a private name then add SymbolFlags.PrivateNamed
        • When checking for unmatched properties, consider a property unmatched if it has the PrivateNamed flag. This has the desired effect of nominalizing classes with private-named members.
    • case 2: private names in class hierarchies do not conflict
      • see test
      • solution implemented:
        • in issueMemberSpecificError, the compiler check for members of conflicting types. We just skip the check if the member is a private name.
  • #constructor is reserved
    • see test
    • check in bindWorker, where every node is visited
  • Accessibility modifiers can't be used with private names
    • see test
    • implemented in checkAccessibilityModifiers, using ModifierFlags.AccessibilityModifier
  • delete #foo not allowed
  • Private name accesses not allowed outside of the defining class

Max Heiber and others added 4 commits August 24, 2018 17:57
- [x] Private name accesses not allowed outside of the defining class
- [x] delete #foo not allowed
- [x] private names not allowed as params
- [x] private names not allowed in variable declarations
- [x] #constructor is reserved
- [x] Private names in class hierarchies don't conflict

Signed-off-by: Max Heiber <[email protected]>
@mheiber mheiber closed this Sep 6, 2018
@mheiber mheiber deleted the checker-no-mangle branch September 6, 2018 19:46
acutmore pushed a commit that referenced this pull request Jun 30, 2021
* Class static block (#9)

* Add types factory and parser

* Add some case

* Make class static block as a container

* Update cases

* Add visitor

* Add emitter and more compile target

* Check boundary of break and continue

* Add basic transformer

* Fix emit behavior

* Add more tests

* Add friend tests

* Update baseline

* Fix cr issues

* Accept baseline

* Add decorator and modifier check

* Add functional boundary check

* Fix conflict

* Fix computed prop name within context

* Add more tests

* Update baseline

* Avoid invalid test baseline

* Support use before initialize check

* wip

* Fix class static block context

* Fix checks

* Fix missing case

* Improve assert message

* Accept baseline

* Avoid new context

* Update diagnostic message

* Fix name collision

* Fix targets

* Avoid unnecessary files

* Add more case

* Add more test cases

* Fix strict mode function declaration

* Avoid private fields initializer if no private identifier references

* Avoid private fields and add more test case

* Add more case

* Add tests and support for related services functionality

* Fix this reference in static block

* Split parser diagnostic and binder diagnostic

Co-authored-by: Ron Buckton <[email protected]>
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 this pull request may close these issues.

1 participant