-
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
Parsing and emit for computed properties #1272
Conversation
function parseComputedPropertyName(): ComputedPropertyName { | ||
var node = <ComputedPropertyName>createNode(SyntaxKind.ComputedPropertyName); | ||
parseExpected(SyntaxKind.OpenBracketToken); | ||
node.expression = allowInAnd(parseAssignmentExpression); |
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.
put a test where "in" is present
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.
Check for yield, generatorParameter. Add tests as well
|
||
// All callers who expect a value to be returned are in fullTypeCheck mode. | ||
// If we are not in type check mode, no need to get the type. | ||
return undefined; |
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.
Debug.assert(!fullTypeCheck)
?
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.
callers are not in fullTypeCheck, but they don't use the returned value.
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've rewritten the code so that this function can only be called in fullTypeCheck
Parsing and emit for computed properties
This is based on the plan in issue #1082. The type checker support, .d.ts generation and language service support (other than navigation items). I plan to work on the type system side next.