Prior to this patch the following template would fail when foo was an instance of dict:
{{#each foo}}
{{@key}}: {{this}}
{{/each}}
In the case where foo = {'bar': 'baz'} one would expect the output to be bar: baz, but instead the output is bar: bar.
The following code addresses this bug by using iter to get the iterable items of the collection, whether it be a list or a dict. If it's a dict, then local_context is set to be the value for the appropriate key before it's passed to the Scope constructor.
Prior to this patch the following template would fail when
foo
was an instance ofdict
:In the case where
foo = {'bar': 'baz'}
one would expect the output to bebar: baz
, but instead the output isbar: bar
.The following code addresses this bug by using
iter
to get the iterable items of the collection, whether it be alist
or adict
. If it's adict
, thenlocal_context
is set to be the value for the appropriate key before it's passed to theScope
constructor.