Skip to content

Commit

Permalink
[As3] do not generate mixed property accessors because mxmlc does not…
Browse files Browse the repository at this point in the history
… like them (fixed issue HaxeFoundation#1175)
  • Loading branch information
Simn committed Oct 31, 2012
1 parent f5094ec commit 3bcacb0
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions genas3.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3bcacb0

Please sign in to comment.