playframework/Play20 — pull request #59 by julienrf (2011-12-30 11:49:12+00:00)
Title: Add convenient factory methods to create JsObjects and JsArrays

These commits allows to define a `JsObject` with the following syntax:

```scala
JsObject(
"foo" -> JsNumber(42),
"bar" -> JsArray(
JsString("baz"),
JsString("bah")
)
)
```

The previous syntax was more noisy:

```scala
JsObject(Map(
"foo" -> JsNumber(42),
"bar" -> JsArray(List(
JsString("baz"),
JsString("bah")
))
))
```

Note: I kept `JsObject` having a `Map` to store its content, although eb8e3fa suggested a `SortedMap` should be used. Indeed, with the current code, creating a `JsObject` from code (instead of using `Json.parse`), which is likely to be done for every `Writes` instance (as [mapWrites](https://github.com/playframework/Play20/blob/93c1741112564fb5d97b756a5cac120ff0c55fbe/framework/src/play/src/main/scala/play/api/libs/json/Writes.scala#L55)), will not preserve values order.