mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Fixed findAllRefs/getOccs bug where private properties declared in the constructor were only local to the constructor.
Fixes #975.
This commit is contained in:
parent
20392de6ef
commit
e3d82b7db3
@ -766,7 +766,7 @@ module ts {
|
||||
}
|
||||
|
||||
export enum SymbolFlags {
|
||||
FunctionScopedVariable = 0x00000001, // Variable (var) or parameter
|
||||
FunctionScopedVariable = 0x00000001, // Variable (var) or parameter
|
||||
Property = 0x00000002, // Property or enum member
|
||||
EnumMember = 0x00000004, // Enum member
|
||||
Function = 0x00000008, // Function
|
||||
|
||||
@ -3836,7 +3836,7 @@ module ts {
|
||||
if (symbol.getFlags() && (SymbolFlags.Property | SymbolFlags.Method)) {
|
||||
var privateDeclaration = forEach(symbol.getDeclarations(), d => (d.flags & NodeFlags.Private) ? d : undefined);
|
||||
if (privateDeclaration) {
|
||||
return privateDeclaration.parent;
|
||||
return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////class ABCD {
|
||||
//// constructor(private x: number, public y: number, private [|z|]: number) {
|
||||
//// }
|
||||
////
|
||||
//// func() {
|
||||
//// return this.[|z|];
|
||||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user