You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It turns out the generator transpilation is doing things correctly but then the "fold constants" pass is producing invalid code. It didn't do this in the previous release because the generator function was brought into the object literal before "fold constants":
function *generator() {...}
{g:generator, x:5, y:6}
became
{*g() {...}, x:5, y:6}
but in the new compiler that does not happen. Will do a bisect and figure out where this changed.
… if we do that then the 'this' value is wrong inside of someFunction.
(It would be safe to do this transformation if someFunction is a function literal and we've verified that it doesn't reference 'this' but for now we don't do it)
#2873
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191825381
Degraded in v20180319
https://kangax.github.io/compat-table/es6/#test-generators_correct_this_binding
input
output
The text was updated successfully, but these errors were encountered: