Skip to content

Commit

Permalink
Wip fix exception rethrow
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed Aug 4, 2024
1 parent 0b1443f commit 95c428f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
11 changes: 1 addition & 10 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ let exn_block_as_obj ~(stack : bool) (el : J.expression list) (ext : J.tag_info)
}
else cause

let exn_ref_as_obj e : J.expression =
let cause = { J.expression_desc = e; comment = None; } in
new_error
(E.record_access cause Js_dump_lit.exception_id 0l)
{
J.expression_desc = Object [ (Lit Js_dump_lit.cause, cause) ];
comment = None;
}

let rec iter_lst cxt (f : P.t) ls element inter =
match ls with
| [] -> cxt
Expand Down Expand Up @@ -1205,7 +1196,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt =
match e.expression_desc with
| Caml_block (el, _, _, ((Blk_extension | Blk_record_ext _) as ext)) ->
{ e with expression_desc = (exn_block_as_obj ~stack:true el ext).expression_desc }
| exp -> { e with expression_desc = (exn_ref_as_obj exp).expression_desc }
| _ -> e
in
P.string f L.throw;
P.space f;
Expand Down
16 changes: 4 additions & 12 deletions jscomp/test/equal_exception_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 95c428f

Please sign in to comment.