Browse Source

Prevent unwanted leading comma (#7553)

Previously `{, a: 1}`, after commit `{a: 1}`
George Corney 7 years ago
parent
commit
b6d56fbb7e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/macro/eval/evalPrinting.ml

+ 2 - 2
src/macro/eval/evalPrinting.ml

@@ -54,7 +54,7 @@ let rec s_object depth o =
 	let buf = Buffer.create 0 in
 	Buffer.add_string buf "{";
 	List.iteri (fun i (k,v) ->
-		if i >= 0 then Buffer.add_string buf ", ";
+		if i > 0 then Buffer.add_string buf ", ";
 		Buffer.add_string buf (rev_hash k);
 		Buffer.add_string buf ": ";
 		Buffer.add_string buf (s_value depth v).sstring;
@@ -143,4 +143,4 @@ and call_value_on vthis v vl =
 	| _ -> exc_string ("Cannot call " ^ (value_string v))
 
 and value_string v =
-	(s_value 0 v).sstring
+	(s_value 0 v).sstring