浏览代码

[js] properly type wrapped errors (see #5405)

this is NOT a proper fix, because:
1. the Dynamic case will still double-wrap and we can't detect that
2. this filter shouldn't be run twice - this is the main issue
Dan Korostelev 9 年之前
父节点
当前提交
303fb2a9ce
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/optimization/filters.ml

+ 1 - 1
src/optimization/filters.ml

@@ -79,7 +79,7 @@ let rec wrap_js_exceptions com e =
 				let ewrap = Codegen.fcall eterr "wrap" [eerr] t_dynamic e.epos in
 				{ e with eexpr = TThrow ewrap }
 			| _ ->
-				let ewrap = { eerr with eexpr = TNew (cerr,[],[eerr]) } in
+				let ewrap = { eerr with eexpr = TNew (cerr,[],[eerr]); etype = TInst (cerr,[]) } in
 				{ e with eexpr = TThrow ewrap }
 			)
 		| _ ->