-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fix crash on aliased, exported @enum tag in jsdoc #36996
Conversation
THe code to bind `@enum` and `@typedef` didn't handle the case that the `@enum` was on a property assignment to an alias of module.exports. Specifically, `x` needs to be correctly aliased to the file's symbol in the example below: ``` var x = module.exports = {}; /** @enum {string} */ x.E = { A: "A" }; ```
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.
Can we add a backlog item to (attempt to) unhackify JS symbol binding and set up everything to use fresh symbols with SymbolFlags.Alias
set, rather than the imprecise mixture of symbol copying, symbol substituting, and fake-symbol-flag-setting we do now?
Here it is: #37000 |
@typescript-bot cherry-pick this to release-3.9 |
Heya @sandersn, I couldn't find the branch 'release-3.9' on Microsoft/TypeScript. You may need to make it and try again. |
@typescript-bot cherry-pick this to release-3.8 |
Good number snipe 👍 |
Component commits: 888ebf4 Fix crash on aliased,exported @enum tag in jsdoc THe code to bind `@enum` and `@typedef` didn't handle the case that the `@enum` was on a property assignment to an alias of module.exports. Specifically, `x` needs to be correctly aliased to the file's symbol in the example below: ``` var x = module.exports = {}; /** @enum {string} */ x.E = { A: "A" }; ```
Component commits: 888ebf4 Fix crash on aliased,exported @enum tag in jsdoc THe code to bind `@enum` and `@typedef` didn't handle the case that the `@enum` was on a property assignment to an alias of module.exports. Specifically, `x` needs to be correctly aliased to the file's symbol in the example below: ``` var x = module.exports = {}; /** @enum {string} */ x.E = { A: "A" }; ``` Co-authored-by: Nathan Shively-Sanders <[email protected]>
The code to bind
@enum
and@typedef
didn't handle the case that the@enum
was on a property assignment to an alias of module.exports.Specifically,
x
needs to be correctly aliased to the file's symbol inthe example below:
Fixes #36983