Skip to content

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Aug 5, 2017

Fixes #12146.

This was made to reuse parseSimpleUnaryExpression when numeric types were implemented by @ahejlsberg - except in the time since, parseSimpleUnaryExpression is not so simple anymore (now that it calls into parseUpdateExpression in the default case, which is what happens in 5 of the 4 cases it is called inside of parseNonArrayType), and can lead you down a short trail into a call to parseLeftHandSideExpressionOrHigher where almost anything could happen. Not what we wanted for type literals, really.

With this change, the parser is once more restricted to just strings, numeric literals, true/false keywords, and numeric literals with a unary minus sign in front of them.

@weswigham weswigham merged commit a453eff into microsoft:master Aug 7, 2017
@weswigham weswigham deleted the forbid-jsdoc-expressions-as-typenodes branch August 7, 2017 16:21
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants