Skip to content

Conversation

@weswigham
Copy link
Member

Fixes a break I noticed in our RWC suite.

@weswigham weswigham requested review from mhegazy and rbuckton May 24, 2018 19:23
@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2018

Please port to release-2.9 as well.

@weswigham weswigham merged commit 4be4e56 into microsoft:master May 24, 2018
@weswigham weswigham deleted the fix-use-strict-placement branch May 24, 2018 19:49
weswigham added a commit to weswigham/TypeScript that referenced this pull request May 24, 2018
mhegazy added a commit that referenced this pull request May 24, 2018
Hoisted declarations should occur after prologue directives (#24386)
export function prependStatements<T extends Statement>(to: T[], from: ReadonlyArray<T> | undefined): T[] | undefined {
if (from === undefined || from.length === 0) return to;
if (to === undefined) return from.slice();
const prologue = to.length && isPrologueDirective(to[0]) && to.shift();
Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible that there is more than one directive. Though I don't know if that occurs in real world code. Should this case be handled here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't handle it in any other locations we check for prologues, I looked. I figured I shouldn't differ here.

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.

3 participants