Skip to content

Commit 4ac1387

Browse files
author
Hongbo Zhang
committed
edge cases
1 parent a2ceb9c commit 4ac1387

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

jscomp/test/.depend

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ js_obj_test.cmj : mt.cmi
334334
js_obj_test.cmx : mt.cmx
335335
js_val.cmj :
336336
js_val.cmx :
337+
jsoo_400_test.cmj : ../stdlib/string.cmi
338+
jsoo_400_test.cmx : ../stdlib/string.cmx
337339
jsoo_485.cmj :
338340
jsoo_485.cmx :
339341
jsoo_485_test.cmj :
@@ -1090,6 +1092,8 @@ js_obj_test.cmo : mt.cmi
10901092
js_obj_test.cmj : mt.cmj
10911093
js_val.cmo :
10921094
js_val.cmj :
1095+
jsoo_400_test.cmo : ../stdlib/string.cmi
1096+
jsoo_400_test.cmj : ../stdlib/string.cmj
10931097
jsoo_485.cmo :
10941098
jsoo_485.cmj :
10951099
jsoo_485_test.cmo :

jscomp/test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ OTHERS := a test_ari test_export2 test_internalOO test_obj_simple_ffi test_scope
5959
optional_ffi_test poly_variant_test \
6060
bs_rest_test infer_type_test fs_test module_as_function\
6161
test_case_set test_mutliple string_bound_get_test inline_string_test\
62-
ppx_this_obj_test unsafe_obj_external gpr_627_test jsoo_485_test
62+
ppx_this_obj_test unsafe_obj_external gpr_627_test jsoo_485_test jsoo_400_test
6363

6464

6565
SOURCE_LIST := js_dyn $(OTHERS)

jscomp/test/jsoo_400_test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
var Caml_int32 = require("../../lib/js/caml_int32");
4+
5+
function u() {
6+
var exit = 0;
7+
var n;
8+
try {
9+
n = 3;
10+
exit = 1;
11+
}
12+
catch (exn){
13+
return 42;
14+
}
15+
if (exit === 1) {
16+
return Caml_int32.div(3, 0);
17+
}
18+
19+
}
20+
21+
exports.u = u;
22+
/* No side effect */

jscomp/test/jsoo_400_test.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let u () =
2+
match String.length "123" with
3+
| n -> 3 / 0
4+
| exception _ -> 42

0 commit comments

Comments
 (0)