benchpressjs / benchpressjs

ultralight javascript templating framework
MIT License
90 stars 17 forks source link

Iterating over `@value` results in incorrect path resolution #97

Open pitaj opened 3 years ago

pitaj commented 3 years ago

Describe the bug

{{{ each people}}}
  {{{ each @value }}} {./name}

In the above, ./name will try to resolve to people[i].name instead of people[i][j].name.

Minimal Reproduction https://runkit.com/pitaj/5fecc2b6246e6e001bac76d9

Versions

Additional context

Will need to provide each iterator level with unique value variables (valuen) and modify relative path resolution (./, ../) to use valuen. This will also open up minimizing optimizations like converting people.pet.name to ./name.

saikarthikp9 commented 11 months ago

Was this never fixed? @pitaj, any reason?

pitaj commented 11 months ago

This has not been fixed, mostly because there hasn't been a ton of demand. I did try to fix it once but didn't get far.