Browse Source

only init dynamic methods if not already defined (in subclass)

Nicolas Cannasse 15 years ago
parent
commit
2db918cb05
2 changed files with 5 additions and 0 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 4 0
      genswf9.ml

+ 1 - 0
doc/CHANGES.txt

@@ -11,6 +11,7 @@
 	all : allow haxe.rtti.Generic + inheritance
 	all : added resource size limit to 12MB (ocaml max_string_size is 16MB + b64)
 	flash : changes in swf handling to work with >16MB swfs
+	flash9 : only init dynamic methods if not already defined (in subclass)
 
 2010-01-09: 2.05
 	js : added js.Scroll

+ 4 - 0
genswf9.ml

@@ -1601,8 +1601,12 @@ let generate_construct ctx fdata c =
 		| Some { eexpr = TFunction fdata } when f.cf_set = MethodAccess true ->
 			let id = ident f.cf_name in
 			write ctx (HFindProp id);
+			write ctx (HGetProp id);
+			let j = jump ctx J3True in
+			write ctx (HFindProp id);
 			write ctx (HFunction (generate_method ctx fdata false));
 			write ctx (HInitProp id);
+			j();			
 		| _ -> ()
 	) c.cl_fields;
 	gen_expr ctx false fdata.tf_expr;