File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1407,8 +1407,14 @@ struct
14071407 let last_semi ?(ret = false ) () =
14081408 if can_omit_semi
14091409 then ()
1410- else if ret && source_map_enabled
1411- then PP. string f " ; "
1410+ else if ret && source_map_enabled && PP. compact f
1411+ then
1412+ (* In Chrome, the debugger will stop right after a return
1413+ statement. We want a whitespace between this statement and
1414+ the next one to avoid confusing this location and the
1415+ location of the next statement. When pretty-printing, this
1416+ is already the case. In compact mode, we add a newline. *)
1417+ PP. string f " ;\n "
14121418 else PP. string f " ;"
14131419 in
14141420 if stop_on_statement s then output_debug_info f loc;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ let%expect_test _ =
7575 3 : (function (globalThis ){
7676 4 : " use strict" ;
7777 5 : var runtime = globalThis.jsoo_runtime;
78- 6 : function id(x){return x; }
78+ 6 : function id(x){return x;}
7979 7 : var Test = [0 , id];
8080 8 : runtime.caml_register_global(0 , Test , " Test" );
8181 9 : return;
@@ -89,7 +89,7 @@ let%expect_test _ =
8989 / dune- root/ test.ml:1 :4 -> 6 :12
9090 / dune- root/ test.ml:1 :7 -> 6 :15
9191 / dune- root/ test.ml:1 :11 -> 6 :18
92- / dune- root/ test.ml:1 :12 -> 6 :28
92+ / dune- root/ test.ml:1 :12 -> 6 :27
9393 / dune- root/ test.ml:1 :12 -> 7 :0
9494 / dune- root/ test.ml:1 :12 -> 7 :7
9595 / builtin/ blackbox.ml:1 :0 -> 7 :14
Original file line number Diff line number Diff line change 11sourcemap for test.bc.js
2- /my/sourceRoot#b.ml:1:4 -> 12: function <>f(x){return x - 1 | 0; }
3- /my/sourceRoot#b.ml:1:6 -> 14: function f(<>x){return x - 1 | 0; }
4- /my/sourceRoot#b.ml:1:10 -> 17: function f(x){<>return x - 1 | 0; }
5- /my/sourceRoot#b.ml:1:15 -> 35 : function f(x){return x - 1 | 0; <>}
2+ /my/sourceRoot#b.ml:1:4 -> 12: function <>f(x){return x - 1 | 0;}
3+ /my/sourceRoot#b.ml:1:6 -> 14: function f(<>x){return x - 1 | 0;}
4+ /my/sourceRoot#b.ml:1:10 -> 17: function f(x){<>return x - 1 | 0;}
5+ /my/sourceRoot#b.ml:1:15 -> 34 : function f(x){return x - 1 | 0;<>}
66/my/sourceRoot#b.ml:1:15 -> 0:<> var Testlib_B = [0, f];
77/my/sourceRoot#b.ml:1:15 -> 7: var <>Testlib_B = [0, f];
You can’t perform that action at this time.
0 commit comments