|
@@ -287,7 +287,9 @@ let gen_class c =
|
|
match follow f.cf_type with
|
|
match follow f.cf_type with
|
|
| TFun ([],_) ->
|
|
| TFun ([],_) ->
|
|
["__string",(EFunction ([],(EBlock [
|
|
["__string",(EFunction ([],(EBlock [
|
|
- EReturn (Some (field p (call p (field p (this p) "toString") []) "__s")),p
|
|
|
|
|
|
+ EVars ["@s",Some (call p (field p (this p) "toString") [])] ,p;
|
|
|
|
+ EIf ((EBinop ("!=",call p (builtin p "typeof") [ident p "@s"],builtin p "tobject"),p),(EReturn (Some (null p)),p),None),p;
|
|
|
|
+ EReturn (Some (field p (ident p "@s") "__s")),p;
|
|
],p)),p)]
|
|
],p)),p)]
|
|
| _ -> []
|
|
| _ -> []
|
|
with Not_found ->
|
|
with Not_found ->
|