Răsfoiți Sursa

[Js] allow __instanceof__ (fixed issue #1846)

Simon Krajewski 12 ani în urmă
părinte
comite
535b199db4
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      genjs.ml

+ 6 - 0
genjs.ml

@@ -364,6 +364,12 @@ let rec gen_call ctx e el in_value =
 		spr ctx ")";
 	| TLocal { v_name = "__js__" }, [{ eexpr = TConst (TString code) }] ->
 		spr ctx (String.concat "\n" (ExtString.String.nsplit code "\r\n"))
+	| TLocal { v_name = "__instanceof__" },  [o;t] ->
+		spr ctx "(";
+		gen_value ctx o;
+		print ctx " instanceof ";
+		gen_value ctx t;
+		spr ctx ")";
 	| TLocal ({v_name = "__define_feature__"}), [_;e] ->
 		gen_expr ctx e
 	| TLocal { v_name = "__feature__" }, { eexpr = TConst (TString f) } :: eif :: eelse ->