You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportclassConfiguration{privatestorage: string;constructor(){this.storage="InMemoryStorageProvider()";}publicuseLocalStorage(): void{// This method will be injected via the prototype.}}
let identifier: ts.Identifier = <ts.Identifier>node;
let identifierSymbol: ts.Symbol = this.checker.getSymbolAtLocation( identifier );
to obtain the identifier and its possible associated symbol when the node is SyntaxKind.Identifier.
for the first 2 references to the private property storage, I obtain the identifier and the symbol (which correctly have the same Id). With the prototype function assigned to useLocalStorage the reference to storage the call to this.checker.getSymbolAtLocation( identifier ) does not return a symbol.
Actual behavior:
I am using the AST to identify identifiers which may be minified/shortened. The 1st and 2nd reference to storage gets shortened as it is a private property.
My expectation was that the reference to storage would have the same symbol ( not undefined ) as the other references to the storage property.
TypeScript Version:
1.8.9
Code
Expected behavior:
When walking the AST I use:
to obtain the identifier and its possible associated symbol when the node is SyntaxKind.Identifier.
for the first 2 references to the private property
storage, I obtain the identifier and the symbol (which correctly have the sameId). With the prototype function assigned to useLocalStorage the reference tostoragethe call tothis.checker.getSymbolAtLocation( identifier )does not return a symbol.Actual behavior:
I am using the AST to identify identifiers which may be minified/shortened. The 1st and 2nd reference to
storagegets shortened as it is a private property.My expectation was that the reference to
storagewould have the same symbol ( not undefined ) as the other references to thestorageproperty.