schmittjoh/twig.js — pull request #23 by jonathaningram (2012-03-07 07:32:34+00:00)
Title: Fix array compiler so that it compiles JavaScript object arrays correctl...

...y

OK obviously we've got no tests for this, so it will be hard for you to want to merge this, however after the fix, templates are generated more correctly.

Before:

```js
context["attr"] = twig.filter.merge("attr" in context ? context["attr"] : null, {0: "class", 1: (((twig.attr(twig.filter.def("attr" in context ? context["attr"] : null), "class", undefined, undefined, true)) ? (twig.filter.def(twig.attr("attr" in context ? context["attr"] : null, "class"), "")) : ("")) + " required")});
```

After:

```js
context["attr"] = twig.filter.merge("attr" in context ? context["attr"] : null, {"class": (((twig.attr(twig.filter.def("attr" in context ? context["attr"] : null), "class", undefined, undefined, true)) ? (twig.filter.def(twig.attr("attr" in context ? context["attr"] : null, "class"), "")) : ("")) + " required")});
```