Stdlib: Removed all references to String constructors in nit stdlib and tests.
[nit.git] / lib / json / json_writer.nit
index d568140..5e5cef2 100644 (file)
@@ -28,7 +28,7 @@ redef class Map[ K, V ]
 
        fun native_to_json( pretty: Bool ): String import to_json_object `{
                json_object *jobj;
-               char *json_native_string;
+               const char *json_native_string;
                String json_string;
 
                jobj = Map_to_json_object( recv );
@@ -40,7 +40,7 @@ redef class Map[ K, V ]
 #else
                json_native_string = json_object_to_json_string( jobj );
 #endif
-               json_string = new_String_from_cstring( json_native_string );
+               json_string = NativeString_to_s( (char*)json_native_string );
                return json_string;
        `}
 
@@ -93,7 +93,7 @@ redef class Sequence[ E ]
 end
 
 redef class String
-       redef fun to_json_object import String::from_cstring `{
+       redef fun to_json_object import NativeString::to_s `{
                char *native_recv = String_to_cstring( recv );
                return json_object_new_string( native_recv );
        `}