Merge: lib/json: fix array serialization
authorJean Privat <jean@pryen.org>
Thu, 9 Mar 2017 15:12:55 +0000 (10:12 -0500)
committerJean Privat <jean@pryen.org>
Thu, 9 Mar 2017 15:12:55 +0000 (10:12 -0500)
commit6d2ff748794837e181d28b09cdc0b98e0b90d7ae
tree33c267f133f57862c0b7c4f884704b12b688733b
parent3397e493fee489ab9341103218af81b85ddc5c93
parenta49bda0ab49a25e558c2fa9eaee3683ff4b8524d
Merge: lib/json: fix array serialization

Fixes serialization error for array subclasses.

Be the following Nit code:

~~~nit
class Foo
    super Array[String]
    serialize

    var foo: String
end

print (new Foo("foo")).serialize_to_json
~~~

Output before:

~~~json
{"__kind":"obj","__id":0,"__class":"Foo", "__items":, "foo":"foo"[]}
~~~

Output after:

~~~json
{"__kind":"obj","__id":0,"__class":"Foo", "foo":"foo", "__items":[]}
~~~

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2388