Browse Source

[lua] Spawn _hx_empty where possible

peyty 9 years ago
parent
commit
3ec8331273
1 changed files with 3 additions and 0 deletions
  1. 3 0
      genlua.ml

+ 3 - 0
genlua.ml

@@ -681,6 +681,9 @@ and gen_expr ?(local=true) ctx e = begin
 		newline ctx;
 		sprln ctx "end";
 		spr ctx "break end";
+	| TObjectDecl [] ->
+		spr ctx "_hx_empty()";
+		ctx.separator <- true
 	| TObjectDecl fields ->
 		spr ctx "_hx_anon(";
 		concat ctx ", " (fun (f,e) -> print ctx "\"%s\", " f; gen_value ctx e) fields;