Skip to content

Commit

Permalink
different Void & Dynamic handling.
Browse files Browse the repository at this point in the history
git-svn-id: http://haxe.googlecode.com/svn/trunk@905 f16182fa-f095-11de-8f43-4547254af6c6
  • Loading branch information
ncannasse committed Jun 14, 2006
1 parent e8b9192 commit ce2ba20
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions genjs.ml
Expand Up @@ -631,6 +631,10 @@ let generate_type ctx = function
| None -> ()
| Some e -> ctx.inits <- e :: ctx.inits);
if not c.cl_extern then generate_class ctx c
| TEnumDecl { e_path = ([],"Bool") } ->
()
| TEnumDecl e when PMap.is_empty e.e_constrs ->
()
| TEnumDecl e -> generate_enum ctx e
| TSignatureDecl _ -> ()

Expand Down
4 changes: 3 additions & 1 deletion genneko.ml
Expand Up @@ -524,7 +524,7 @@ let gen_type ctx t =
else
gen_class ctx c
| TEnumDecl e ->
if e.e_path = ([],"Bool") then
if e.e_path = ([],"Bool") || PMap.is_empty e.e_constrs then
null (pos e.e_pos)
else
gen_enum e
Expand Down Expand Up @@ -584,6 +584,8 @@ let gen_boot hres =

let gen_name acc t =
match t with
| TEnumDecl e when PMap.is_empty e.e_constrs || e.e_path = ([],"Bool") ->
acc
| TEnumDecl e ->
let p = pos e.e_pos in
let name = fst e.e_path @ [snd e.e_path] in
Expand Down
2 changes: 2 additions & 0 deletions std/js/Boot.hx
Expand Up @@ -227,7 +227,9 @@ class Boot {
return oldsub.apply(this,[pos,len]);
};
Int = __new__("Object");
Dynamic = __new__("Object");
Float = __js__("Number");
Bool = __new__("Object");
Bool["true"] = true;
Bool["false"] = false;
__js__("$closure = js.Boot.__closure");
Expand Down
1 change: 1 addition & 0 deletions std/neko/Boot.hx
Expand Up @@ -131,6 +131,7 @@ class Boot {
Int = __dollar__new(null);
Float = __dollar__new(null);
Bool = __dollar__new(null);
Dynamic = __dollar__new(null);
__dollar__objset(Bool,__dollar__hash("true".__s),true);
__dollar__objset(Bool,__dollar__hash("false".__s),false);
__dollar__exports.__unserialize = __unserialize;
Expand Down

0 comments on commit ce2ba20

Please sign in to comment.