Skip to content

Switch to arrow for ts class wrapper IIFE#18027

Merged
rbuckton merged 2 commits into
masterfrom
fix16924
Aug 25, 2017
Merged

Switch to arrow for ts class wrapper IIFE#18027
rbuckton merged 2 commits into
masterfrom
fix16924

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

This change switches the TypeScript class wrapper IIFE created by the ts transformer to use an arrow function rather than a function expression. This allows the es2015 transform to accurately determine whether it should capture this as _this in the correct places.

Fixes #16924

Copy link
Copy Markdown
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I can't tell if there are relevant tests with this change. The code itself looks good.



//// [output.js]
var _this = this;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

which tests were incorrect before this change? This is the closest one that I've found.

Copy link
Copy Markdown
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Approved after the test from the bug is added.

@rbuckton rbuckton merged commit 05402b8 into master Aug 25, 2017
@rbuckton
Copy link
Copy Markdown
Contributor Author

This has been ported to release-2.5

@rbuckton rbuckton deleted the fix16924 branch August 25, 2017 00:03
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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