-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix handling of function declarations in loops with let/consts #1127
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
Conversation
@@ -708,6 +708,46 @@ public void testDoWhileForOfCapturedLet() { | |||
"} while (false);")); | |||
} | |||
|
|||
public void testIssue1124() { |
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.
I think there's a convention that "issue 1124" means 1124 on code.google.com. Let's add a comment with a link so it's unambiguous.
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
@@ -343,6 +343,10 @@ private void transformLoopClosure() { | |||
} | |||
|
|||
// Change reference to GETPROP. |
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.
Now this comment is misplaced.
Can you make sure the pull request description is thorough since that will end up being the CL description internally? |
I assume "pull request description" is just the first comment? |
Not sure but I'm seeing this now, which is much better :)
|
Sounds good :) |
Should we merge this? |
" ($jscomp$loop$0.x)();", | ||
" };", | ||
" }($jscomp$loop$0);", | ||
" $jscomp$loop$0 = {x:$jscomp$loop$0.x};", |
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.
This seems quite strange but I guess that's not really related to this CL.
Fix handling of function declarations in loops with let/consts
Convert function declaration to variable declaration so that the IIFE can still be applied.
Unmark calls to captured functions like $jscomp$loop.x() as FREE_CALL.
Fixes #1124