Skip to content
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

Merged
merged 13 commits into from
Nov 27, 2014
Merged

Conversation

JsonFreeman
Copy link
Contributor

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.

function parseComputedPropertyName(): ComputedPropertyName {
var node = <ComputedPropertyName>createNode(SyntaxKind.ComputedPropertyName);
parseExpected(SyntaxKind.OpenBracketToken);
node.expression = allowInAnd(parseAssignmentExpression);
Copy link
Contributor

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

Copy link
Contributor

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug.assert(!fullTypeCheck)?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

JsonFreeman added a commit that referenced this pull request Nov 27, 2014
Parsing and emit for computed properties
@JsonFreeman JsonFreeman merged commit 05fd2e9 into master Nov 27, 2014
@JsonFreeman JsonFreeman deleted the computedProperties branch November 27, 2014 04:16
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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.

4 participants