Skip to content
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

Fix arrow function lowering failing to emit var _this decl #2302

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

nkeynes
Copy link
Contributor

@nkeynes nkeynes commented Jun 5, 2022

Fixes issue where the synthetic _this variable was being dropped, so that:

function foo(a) { 
  arr.forEach(e=>this.foo(e));
}

was incorrectly lowered to the nonfunctional code:

function foo(a) {
  arr.forEach(function(e) {
    return _this.foo(e);
  });
}

@evanw
Copy link
Owner

evanw commented Jun 8, 2022

Thanks for the fix. This code clearly should have been covered by tests. Sorry about that.

A note for myself: Looks like this was introduced in version 0.7.2 (specifically in this commit) and regressed recently in version 0.14.30 (specifically in this commit).

@evanw evanw merged commit f6dddf4 into evanw:master Jun 8, 2022
evanw added a commit that referenced this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants