Skip to content

Support exclamationToken in updateProperty and createProperty#21577

Merged
1 commit merged intomasterfrom
updateProperty
Feb 2, 2018
Merged

Support exclamationToken in updateProperty and createProperty#21577
1 commit merged intomasterfrom
updateProperty

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Feb 2, 2018

I figured it would be easier to have a questionOrExclamationToken parameter instead of two separate ones if we don't plan on having those ever both present at the same time.

@ghost ghost requested a review from rbuckton February 2, 2018 18:49
@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 2, 2018

Waiting for @rbuckton to review too

Comment thread src/compiler/factory.ts
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
node.questionToken = questionToken;
node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === SyntaxKind.QuestionToken ? questionOrExclamationToken : undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This leads me to wonder why we have two separate properties for this on PropertyDeclaration.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, that's unfortunate...

@ghost ghost merged commit 567fba2 into master Feb 2, 2018
@ghost ghost deleted the updateProperty branch February 2, 2018 21:03
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
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.

2 participants