Prechádzať zdrojové kódy

fix for super variables when no super constructor

Nicolas Cannasse 9 rokov pred
rodič
commit
6e69281ba0
1 zmenil súbory, kde vykonal 9 pridanie a 0 odobranie
  1. 9 0
      genswf9.ml

+ 9 - 0
genswf9.ml

@@ -2017,7 +2017,16 @@ let check_constructor ctx c f =
 			error "You cannot assign some super class vars before calling super() in flash, this will reset them to default value" e.epos
 			error "You cannot assign some super class vars before calling super() in flash, this will reset them to default value" e.epos
 		| _ -> ()
 		| _ -> ()
 	in
 	in
+	(* only do so if we have a call to super() *)
+	let rec has_super e =
+		Type.iter has_super e;
+		match e.eexpr with
+		| TCall ({ eexpr = TConst TSuper },_) -> raise Exit
+		| _ -> ()
+	in
 	try
 	try
+		has_super f.tf_expr
+	with Exit -> try
 		loop f.tf_expr
 		loop f.tf_expr
 	with Exit ->
 	with Exit ->
 		()
 		()