-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix SequencePointBuilder skipping moved member initializers #3712
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -163,12 +163,28 @@ public override void VisitBlockStatement(BlockStatement blockStatement) | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| public override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration) | ||||||
| { | ||||||
| foreach (var variable in fieldDeclaration.Variables) | ||||||
| { | ||||||
| if (!variable.AssignToken.IsNull || !variable.Initializer.IsNull) | ||||||
| { | ||||||
| VisitAsSequencePoint(variable); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is it on purpose that you pass the |
||||||
| } | ||||||
| } | ||||||
| base.VisitFieldDeclaration(fieldDeclaration); | ||||||
| } | ||||||
|
|
||||||
| public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration) | ||||||
| { | ||||||
| if (!propertyDeclaration.ExpressionBody.IsNull) | ||||||
| { | ||||||
| VisitAsSequencePoint(propertyDeclaration.ExpressionBody); | ||||||
| } | ||||||
| else if (!propertyDeclaration.Initializer.IsNull) | ||||||
| { | ||||||
| VisitAsSequencePoint(propertyDeclaration.Initializer); | ||||||
| } | ||||||
| else | ||||||
| { | ||||||
| base.VisitPropertyDeclaration(propertyDeclaration); | ||||||
|
|
@@ -202,6 +218,18 @@ public override void VisitForStatement(ForStatement forStatement) | |||||
| VisitAsSequencePoint(forStatement.EmbeddedStatement); | ||||||
| } | ||||||
|
|
||||||
| public override void VisitEventDeclaration(EventDeclaration eventDeclaration) | ||||||
| { | ||||||
| foreach (var variable in eventDeclaration.Variables) | ||||||
| { | ||||||
| if (!variable.AssignToken.IsNull || !variable.Initializer.IsNull) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| { | ||||||
| VisitAsSequencePoint(variable); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
| } | ||||||
| base.VisitEventDeclaration(eventDeclaration); | ||||||
| } | ||||||
|
|
||||||
| public override void VisitSwitchStatement(SwitchStatement switchStatement) | ||||||
| { | ||||||
| StartSequencePoint(switchStatement); | ||||||
|
|
||||||
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 don't think that there can be an initializer without an assign token?