|
@@ -465,15 +465,10 @@ let on_inherit ctx c p h =
|
|
|
Adds member field initializations as assignments to the constructor
|
|
|
*)
|
|
|
let add_field_inits com c =
|
|
|
- let rec can_init_inline cf e = match com.platform,e.eexpr with
|
|
|
- (* Flash8 and As3 can init a lot of things with some exceptions *)
|
|
|
- | Flash8, TBlock _ -> false
|
|
|
- | Flash8, _ -> true
|
|
|
- | Flash,_ when Common.defined com "as3" -> true
|
|
|
- (* Php can init literals when the field has no setter *)
|
|
|
- | Php, TConst _ when (match cf.cf_kind with Var({v_write = AccCall _}) -> false | _ -> true) -> true
|
|
|
- (* Flash9 should support some field inits as well, but they are currently not generated *)
|
|
|
- | Flash, TConst _ -> false
|
|
|
+ let rec can_init_inline cf e = match com.platform with
|
|
|
+ | Flash8 -> true
|
|
|
+ | Flash when Common.defined com "as3" -> true
|
|
|
+ | Php when (match cf.cf_kind with Var({v_write = AccCall _}) -> false | _ -> true) -> true
|
|
|
| _ -> false
|
|
|
in
|
|
|
let inits = List.filter (fun cf ->
|