Browse Source

fix order of anonymous objects init

Nicolas Cannasse 18 years ago
parent
commit
5b0e130516
2 changed files with 2 additions and 1 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -2,6 +2,7 @@
 	use _sans font for default flash traces (better Linux support)
 	fixed haxe.remoting.Connection compilation for Flash<8
 	added fix to prevent 64K identifiers limit on Flash<9
+	ensure order of anonymous fields initialization
 
 2007-08-29: 1.15
 	fixed bug with Enum.construct when Enum have type parameters

+ 1 - 1
typer.ml

@@ -1718,7 +1718,7 @@ and type_expr ctx ?(need_val=true) (e,p) =
 		let fields , types = List.fold_left loop ([],PMap.empty) fl in
 		let x = ref Const in
 		ctx.opened <- x :: ctx.opened;
-		mk (TObjectDecl fields) (TAnon { a_fields = types; a_status = x }) p
+		mk (TObjectDecl (List.rev fields)) (TAnon { a_fields = types; a_status = x }) p
 	| EArrayDecl el ->
 		let t = ref (mk_mono()) in
 		let el = List.map (fun e ->