|
@@ -1099,14 +1099,14 @@ let generate_enum ctx e =
|
|
|
| TFun (args,_) ->
|
|
|
let sargs = String.concat "," (List.map (fun (n,_,_) -> ident n) args) in
|
|
|
print ctx "function(%s) { var $x = [\"%s\",%d,%s]; $x.__enum__ = %s;" sargs f.ef_name f.ef_index sargs p;
|
|
|
- if has_feature ctx "may_print_enum" then
|
|
|
+ if has_feature ctx "has_enum" then
|
|
|
spr ctx " $x.toString = $estr;";
|
|
|
spr ctx " return $x; }";
|
|
|
ctx.separator <- true;
|
|
|
| _ ->
|
|
|
print ctx "[\"%s\",%d]" f.ef_name f.ef_index;
|
|
|
newline ctx;
|
|
|
- if has_feature ctx "may_print_enum" then begin
|
|
|
+ if has_feature ctx "has_enum" then begin
|
|
|
print ctx "%s%s.toString = $estr" p (field f.ef_name);
|
|
|
newline ctx;
|
|
|
end;
|
|
@@ -1329,7 +1329,7 @@ let generate com =
|
|
|
(* TODO: fix $estr *)
|
|
|
let vars = [] in
|
|
|
let vars = (if has_feature ctx "Type.resolveClass" || has_feature ctx "Type.resolveEnum" then ("$hxClasses = " ^ (if ctx.js_modern then "{}" else "$hxClasses || {}")) :: vars else vars) in
|
|
|
- let vars = if has_feature ctx "may_print_enum"
|
|
|
+ let vars = if has_feature ctx "has_enum"
|
|
|
then ("$estr = function() { return " ^ (ctx.type_accessor (TClassDecl { null_class with cl_path = ["js"],"Boot" })) ^ ".__string_rec(this,''); }") :: vars
|
|
|
else vars in
|
|
|
(match List.rev vars with
|