captureExpression shouldn't be used when compiling arrow functions
sdegueldre opened this issue · 0 comments
sdegueldre commented
We would expect this code to log 2, but it logs 1: all values from the context that are used by the function are frozen at function definition time.
Originally, this was meant to deal with loop variables, for which we want a new binding at every loop iteration, but it is overzealous and freezes all free variables.
consider the case of slots