Skip to content

Support exclamationToken in updateProperty and createProperty - #21577

Merged
1 commit merged into
masterfrom
updateProperty
Feb 2, 2018
Merged

1 commit merged into
masterfrom
updateProperty

Conversation

@ghost

Copy link
Copy Markdown

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 Ron Buckton (rbuckton) February 2, 2018 18:49
@ghost

Copy link
Copy Markdown
Author

Waiting for Ron Buckton (@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 (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

2 participants