lib/json: fix array serialization
authorAlexandre Terrasa <alexandre@moz-code.org>
Mon, 6 Mar 2017 23:17:13 +0000 (18:17 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Mon, 6 Mar 2017 23:17:24 +0000 (18:17 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/json/serialization_write.nit

index 9a2c9e5..efbf22a 100644 (file)
@@ -325,12 +325,12 @@ redef class SimpleCollection[E]
                        v.stream.write """","""
                        v.new_line_and_indent
                        v.stream.write """"__items": """
-
+                       serialize_to_pure_json v
                        core_serialize_to v
+               else
+                       serialize_to_pure_json v
                end
 
-               serialize_to_pure_json v
-
                if not v.plain_json then
                        v.indent_level -= 1
                        v.new_line_and_indent