Nicolas Cannasse 17 years ago
parent
commit
1b1f710b48
3 changed files with 11 additions and 3 deletions
  1. 4 0
      doc/CHANGES.txt
  2. 5 0
      genas3.ml
  3. 2 3
      genswf.ml

+ 4 - 0
doc/CHANGES.txt

@@ -1,3 +1,7 @@
+2008-??-??: 1.18
+	some optimization and bugfix for as3 codegen
+	bugfix : allow bitmaps and fonts classes for F9 library
+
 2008-01-13: 1.17
 	fixed Int32.compare, added Int32.read and Int32.write
 	fixed type of unitialized registers in flash9

+ 5 - 0
genas3.ml

@@ -447,7 +447,10 @@ and gen_expr ctx e =
 		b();
 	| TFunction f ->
 		let h = gen_function_header ctx None f [] e.epos in
+		let old = ctx.in_static in
+		ctx.in_static <- true;
 		gen_expr ctx (block f.tf_expr);
+		ctx.in_static <- old;
 		h();
 	| TCall (e,el) ->
 		gen_call ctx e el
@@ -679,6 +682,8 @@ and gen_value ctx e =
 		let v = value true in
 		gen_expr ctx e;
 		v()
+	| TBlock [e] ->
+		gen_value ctx e
 	| TBlock el ->
 		let v = value true in
 		let rec loop = function

+ 2 - 3
genswf.ml

@@ -111,9 +111,8 @@ let movieclip_exists types path =
 	List.exists (function
 		| TClassDecl c when c.cl_path = path ->
 			(match c.cl_super with
-			| Some ({ cl_path = ["flash";"display"],"MovieClip" },[])
-			| Some ({ cl_path = ["flash";"display"],"Sprite" },[]) -> ()
-			| _ -> failwith ("The class " ^ name ^ " must either extends MovieClip or Sprite"));
+			| Some ({ cl_path = "flash" :: _ ,_ },[]) -> ()
+			| _ -> failwith ("The class " ^ name ^ " must either extends a flash.* class"));
 			not c.cl_extern
 		| TEnumDecl e when e.e_path = path -> failwith ("The clip " ^ name ^ " must be bound to a class")
 		| TTypeDecl t when t.t_path = path -> failwith ("The clip " ^ name ^ " must be bound to a class")