canjs / can-stache

Live binding handlebars templates
https://canjs.com/doc/can-stache.html
MIT License
10 stars 13 forks source link

check if the scope already has a LetContext before adding one #707

Open nlundquist opened 5 years ago

nlundquist commented 5 years ago

Pushed this after discussion with Justin, but upon reflection, I don't think we can make this change. Whenever a template is rendered a new LetContext probably should be added.

The only case where we might be able to avoid this is when the "leaf" context is already a LetContext, but even then, we can't be sure that we shouldn't be adding another one. I think it's probably preferable to have an extra LetContext than not adding one when we should be.

Putting this PR up for further discussion.