Bläddra i källkod

[js] follow exception type in wrap_js_exceptions

Dan Korostelev 10 år sedan
förälder
incheckning
fd1fb9f46b
1 ändrade filer med 5 tillägg och 4 borttagningar
  1. 5 4
      filters.ml

+ 5 - 4
filters.ml

@@ -143,10 +143,11 @@ let rec wrap_js_exceptions com e =
 	let terr = List.find (fun mt -> match mt with TClassDecl {cl_path = ["js";"_Boot"],"HaxeError"} -> true | _ -> false) com.types in
 	let terr = List.find (fun mt -> match mt with TClassDecl {cl_path = ["js";"_Boot"],"HaxeError"} -> true | _ -> false) com.types in
 	let cerr = match terr with TClassDecl c -> c | _ -> assert false in
 	let cerr = match terr with TClassDecl c -> c | _ -> assert false in
 
 
-	let rec is_error = function
-	| TInst ({cl_path = (["js"],"Error")},_) -> true
-	| TInst ({cl_super = Some (csup,tl)}, _) -> is_error (TInst (csup,tl))
-	| _ -> false
+	let rec is_error t =
+		match follow t with
+		| TInst ({cl_path = (["js"],"Error")},_) -> true
+		| TInst ({cl_super = Some (csup,tl)}, _) -> is_error (TInst (csup,tl))
+		| _ -> false
 	in
 	in
 
 
 	let rec loop e =
 	let rec loop e =