Closed georgkoester closed 9 years ago
@georgkoester just to follow up, since data
is referenced by name (instead of data_0
etc) in <js>
eval blocks only, it made sense to reset the assignment before the eval'd code instead of after the for loop. This avoids extra, unnecessary data = data_0
statements in the compiled output. I went ahead and made this change and added additional tests for data context in nested for loops.
Great catch, I'm glad we got this one fixed!
After a loop completes, the
data
variable is still set to the loop's data context.When accessing the
data
variable inside of a<js>
block, we'll end up with the outside context set to the inside context when the<js>
block ends.