Skip to content

Change es2015 transform to retain comments on for of loop bodies#22396

Merged
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-for-ending-comments
Mar 16, 2018
Merged

Change es2015 transform to retain comments on for of loop bodies#22396
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-for-ending-comments

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes a change in our RWC suite.

When comment emit got greatly improved recently, it shifted the responsibility of what node needed to have correct positions to actually retain comments in the tested scenario. With this change, the es2015 transform will now actually set the original node and positions on the block of a for of loop, if present, when it is transformed, so it can retain comments attached to its opening and closing tokens. Incidentally, the comment:

// The old emitter does not emit source maps for the block.
// We add the location to preserve comments.

seemed to indicate a TODO with respect to the sourcemaps, which I gather I have just done, by using updateBlock instead of always making a synthetic one.

@weswigham weswigham assigned sandersn and rbuckton and unassigned sandersn and rbuckton Mar 8, 2018
@weswigham weswigham requested review from rbuckton and sandersn March 8, 2018 23:05
@weswigham weswigham merged commit 2d01d76 into microsoft:master Mar 16, 2018
@weswigham weswigham deleted the fix-for-ending-comments branch March 16, 2018 19:58
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
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