Allow variable statements used as declaration sites to be marked visible#22798
Conversation
…ble and included in declaration emit by alias marking
917d939 to
d5179ae
Compare
| isDeclarationVisible(anyImportSyntax.parent)) { | ||
| return addVisibleAlias(declaration, anyImportSyntax); | ||
| } | ||
| else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && |
There was a problem hiding this comment.
should not we do this for all declarations and not jsut variable declarations? e.g. #23127
There was a problem hiding this comment.
So allow private interfaces, types, anything - to be marked and emitted?
There was a problem hiding this comment.
why are variables any special? they are all declarations..
There was a problem hiding this comment.
Mostly just because they're only used to name unique symbols. I can update to handle the other kinds of declaration statements, but it'll require more work to light up each private declaration kind in the declaration emitter.
There was a problem hiding this comment.
u want to get this in first then do the other ones? that is fine by me as well.. but we need to do them all, no point in half doing it.
There was a problem hiding this comment.
Also did @mhegazy's ask included making it visible all the time.. I thought it implied only in export = case i think, because other wise we would be making lot of stuff visible which might not be intended?
There was a problem hiding this comment.
he added code later on to make it emit an extra export {}; at the bottom, this should change the module scoping.
There was a problem hiding this comment.
@sheetalkamat The aliases that get returned by this function are the statements the emitter needs to revisit - they are not blindly emitted. The visibility is actually handled by setting isVisible on the node links (done in addVisibleAlias), which is only done on the specific variable declaration that is the symbol's source.
There was a problem hiding this comment.
can you add a test wherein only one variable declaration becomes visible. Thanks.
And included in declaration emit by alias marking.
Fixes #20080 (replacing #20169)