Bläddra i källkod

fixed as3 classes ordering

Nicolas Cannasse 18 år sedan
förälder
incheckning
385e3ab36d
2 ändrade filer med 4 tillägg och 3 borttagningar
  1. 1 0
      doc/CHANGES.txt
  2. 3 3
      genswf.ml

+ 1 - 0
doc/CHANGES.txt

@@ -10,6 +10,7 @@
 	added haxe.xml.Fast.innerHTML
 	added Reflect.compare
 	fixed "".split() in Neko (now returns [""] instead of [])
+	bugfix for swf-lib f9 classes ordering
 
 2008-01-13: 1.17
 	fixed Int32.compare, added Int32.read and Int32.write

+ 3 - 3
genswf.ml

@@ -145,7 +145,7 @@ let generate file ver header infile types hres =
 				[]
 			| _ ->
 				ctx.f9clips <- [{ f9_cid = None; f9_classname = boot }];
-				code
+				List.rev code
 		);
 		ctx.genmethod <- m;
 	end else begin
@@ -192,7 +192,7 @@ let generate file ver header infile types hres =
 			if c.f9_cid <> None && not (movieclip_exists types path) then
 				ctx.as3code <- build_movieclip ctx path :: ctx.as3code;
 		) ctx.f9clips;
-		let as3code = (match ctx.as3code with [] -> [] | l -> [tag (TActionScript3 (None,As3hlparse.flatten l))]) in
+		let as3code = (match ctx.as3code with [] -> [] | l -> [tag (TActionScript3 (None,As3hlparse.flatten (List.rev l)))]) in
 		let clips9 = (if ver = 9 then [tag (TF9Classes ctx.f9clips)] else []) in
 		sandbox @ debug @ content @ clips @ code @ as3code @ clips9
 	in
@@ -261,7 +261,7 @@ let generate file ver header infile types hres =
 							| None -> true
 							| Some path -> not (List.exists (fun t -> Type.t_path t = path) types)
 						) inits in
-						ctx.as3code <- inits @ ctx.as3code;
+						ctx.as3code <- List.rev inits @ ctx.as3code;
 					end;
 					loop acc l
 				| _ ->