Closed dtrudg closed 2 years ago
@mvdan @cclerget - I believe that this is a valid fix for #806 - cheers.
Thanks! I'll most likely tag v3.4.3 including this fix in a few days. In the meantime, you can either use master or the v3.4 branch, which is where I'm cherry-picking the bugfix changes on top of v3.4.2.
In dc2e11e
unset
of a global var inside a function was broken, as the special handling ofexport
orreadonly
in function scope introduced in that commit also incorrectly capturedunset
, calling a parent.Set with the previous value.Ensure we do not capture unset in the function scope global handling.
Unset of a global can fall-through this code. Globals are unset correctly further down the Set function, so we do not need to invoke a parent.Set at all.
Fixes mvdan#806