Fix crash on aliased, exported @enum tag in jsdoc#36996
Merged
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"
};
```
weswigham
approved these changes
Feb 24, 2020
Member
There was a problem hiding this comment.
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?
Member
Author
|
Here it is: #37000 |
Member
Author
|
@typescript-bot cherry-pick this to release-3.9 |
Collaborator
|
Heya @sandersn, I couldn't find the branch 'release-3.9' on Microsoft/TypeScript. You may need to make it and try again. |
Member
Author
|
@typescript-bot cherry-pick this to release-3.8 |
Member
Good number snipe 👍 |
typescript-bot
pushed a commit
to typescript-bot/TypeScript
that referenced
this pull request
Feb 25, 2020
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" }; ```
Collaborator
sandersn
added a commit
that referenced
this pull request
Feb 25, 2020
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code to bind
@enumand@typedefdidn't handle the case that the@enumwas on a property assignment to an alias of module.exports.Specifically,
xneeds to be correctly aliased to the file's symbol inthe example below:
Fixes #36983