Ver código fonte

[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 anos atrás
pai
commit
303fb2a9ce
1 arquivos alterados com 1 adições e 1 exclusões
  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 }
 			)
 		| _ ->