About the PR.
There was a difference in "@index" and "@key" special variables in "#each" helper between PHP and JavaScript version of Handlebars. JS version provides "@index" for all containers (both objects and arrays) and "@key" for objects. Here is a proof fiddle: http://jsfiddle.net/5e7vS/1/. At the same time PHP version provides either "@key" or "@index" depending on a container type.
Also, as wrote in #46 there was no "@first"/"@last" elements in "#each" helper.
About implementation.
I've assumed that only PHP arrays with sequential numeric keys are equivalent to JavaScript arrays. For such "arrays" "@index", "@first" and "@last" special variables are available in "#each" helper.
On the other hand, all other arrays and instances of \Traversable are treated as JavaScript objects. For such "objects" "@index", "@key" and "@first" special variables are available in "#each" helper.
About the PR. There was a difference in "@index" and "@key" special variables in "#each" helper between PHP and JavaScript version of Handlebars. JS version provides "@index" for all containers (both objects and arrays) and "@key" for objects. Here is a proof fiddle: http://jsfiddle.net/5e7vS/1/. At the same time PHP version provides either "@key" or "@index" depending on a container type.
Also, as wrote in #46 there was no "@first"/"@last" elements in "#each" helper.
About implementation. I've assumed that only PHP arrays with sequential numeric keys are equivalent to JavaScript arrays. For such "arrays" "@index", "@first" and "@last" special variables are available in "#each" helper.
On the other hand, all other arrays and instances of
\Traversable
are treated as JavaScript objects. For such "objects" "@index", "@key" and "@first" special variables are available in "#each" helper.