-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Avoid the double-symbol trick for enums #39955
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
Conversation
39a980b
to
22cb2e6
Compare
Nameless jsdoc typedefs have their exportedness controlled by the exportedness of the location they pull their name from. Fixes microsoft#33575.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But definitely get @sandersn to review, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question before I sign off.
// 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or | ||
if (!isJSDocEnumTag(node) && !!node.fullName) return true; | ||
// 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). | ||
const declName = getNameOfDeclaration(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the code below here only for nameless typedefs, or can declName
be a node inside a jsdoc comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I convinced myself that the last half of the new function will do the right thing, but I think there may be jsdoc-only/named typedef cases that fall through to the final return false
Nameless jsdoc typedefs have their exportedness controlled by the
exportedness of the location they pull their name from.
Fixes #33575.