2
0
Эх сурвалжийг харах

[As3] do not generate mixed property accessors because mxmlc does not like them (fixed issue #1175)

Simon Krajewski 13 жил өмнө
parent
commit
3bcacb0b97
1 өөрчлөгдсөн 4 нэмэгдсэн , 11 устгасан
  1. 4 11
      genas3.ml

+ 4 - 11
genas3.ml

@@ -1019,28 +1019,21 @@ let generate_field ctx static f =
 			let t = type_str ctx f.cf_type p in
 			let id = s_ident f.cf_name in
 			let v = (match f.cf_kind with Var v -> v | _ -> assert false) in
-			(match v.v_read with
-			| AccNormal ->
+ 			(match v.v_read with
+			| AccNormal | AccNo | AccNever ->
 				print ctx "%s function get %s() : %s { return $%s; }" rights id t id;
 				newline ctx
 			| AccCall m ->
 				print ctx "%s function get %s() : %s { return %s(); }" rights id t m;
 				newline ctx
-			| AccNo | AccNever ->
-				print ctx "%s function get %s() : %s { return $%s; }" (if v.v_read = AccNo then "protected" else "private") id t id;
-				newline ctx
-			| _ ->
-				());
+			| _ -> ());
 			(match v.v_write with
-			| AccNormal ->
+			| AccNormal | AccNo | AccNever ->
 				print ctx "%s function set %s( __v : %s ) : void { $%s = __v; }" rights id t id;
 				newline ctx
 			| AccCall m ->
 				print ctx "%s function set %s( __v : %s ) : void { %s(__v); }" rights id t m;
 				newline ctx
-			| AccNo | AccNever ->
-				print ctx "%s function set %s( __v : %s ) : void { $%s = __v; }" (if v.v_write = AccNo then "protected" else "private") id t id;
-				newline ctx
 			| _ -> ());
 			print ctx "%sprotected var $%s : %s" (if static then "static " else "") (s_ident f.cf_name) (type_str ctx f.cf_type p);
 			gen_init()