-
Notifications
You must be signed in to change notification settings - Fork 12.8k
handle multiple prologue directives #25561
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
handle multiple prologue directives #25561
Conversation
@rbuckton and @weswigham can you please review this change |
let statementIndex = 0; | ||
// skip all prologue directives to insert at the correct position | ||
for (; statementIndex < to.length; ++statementIndex) { | ||
if (!isPrologueDirective(to[statementIndex])) { |
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.
prependStatements
shouldn't care about prologue directives. This logic should be handled elsewhere at the call site instead.
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.
Just rename prependStatements
- every single one of it's callsites needs to do this.
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.
That's probably fine. The general-purpose name of prependStatements
means it could be used in any place where there's a statement list, including a Block
or a CaseClause
, which don't support prologue directives. Giving it a more specific name would remove that concern.
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.
done
@rbuckton one more look? |
Fixes: #24689