See comment in
The <loop> element is special when used with foreach, in that it should be removed on processing. When the data is asynchronous, the loop element is not dropped.
Compare the 'loopElement' and 'asyncLoopElement' tests.
Created attachment 565619 [details] [diff] [review]
This patch fixes the bug is question and tidies up a few minor things. It also uncomments the test for this bug.
Comment on attachment 565619 [details] [diff] [review]
upload 1: https://hg.mozilla.org/integration/fx-team/rev/cf6f3b701980