Skip to content

Conversation

sandersn
Copy link
Member

Previously, they were mistakenly treated as private because of a check that required all super property accesses (like super.x()) to be references to a MethodDeclaration or MethodSignature. This change also allows PrototypeProperty special assignment kinds.

Fixes #26475

Previously, they were mistakenly treated as private because of a check
that required all super property accesses (like `super.x()`) to be
references to a MethodDeclaration or MethodSignature. This change also
allows PrototypeProperty special assignment kinds.
@sandersn sandersn requested review from a user and RyanCavanaugh August 15, 2018 22:54
@@ -17866,6 +17866,12 @@ namespace ts {

function symbolHasNonMethodDeclaration(symbol: Symbol) {
return forEachProperty(symbol, prop => {
Copy link

@ghost ghost Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing this function body with return !!forEachProperty(symbol, prop => !(prop.flags & SymbolFlags.Method)); seems to pass all tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That's a much better solution.

@sandersn
Copy link
Member Author

sandersn commented Aug 16, 2018

Oops. Uh, I merged @Andy-MS' much better solution into master by mistake. I'll cherry-pick it back into this review so I can get the tests as well.

Edit: Here is the commit 56f8256

@sandersn sandersn merged commit 75071a2 into master Aug 16, 2018
@sandersn sandersn deleted the js/allow-super-references-to-ctor-func-methods branch August 16, 2018 16:20
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