1
1
'use strict' ;
2
2
3
+ var Mt = require ( "./mt.js" ) ;
3
4
var Caml_exceptions = require ( "../../lib/js/caml_exceptions.js" ) ;
5
+ var Caml_js_exceptions = require ( "../../lib/js/caml_js_exceptions.js" ) ;
4
6
var Caml_builtin_exceptions = require ( "../../lib/js/caml_builtin_exceptions.js" ) ;
5
7
6
8
function f ( match ) {
7
- if ( Caml_exceptions . isCamlExceptionOrOpenVariant ( match ) ) {
9
+ if ( Caml_exceptions . caml_is_extension ( match ) ) {
8
10
if ( match === Caml_builtin_exceptions . not_found ) {
9
11
return 0 ;
10
12
} else if ( match [ 0 ] === Caml_builtin_exceptions . invalid_argument || match === Caml_builtin_exceptions . stack_overflow ) {
@@ -23,7 +25,7 @@ var A = Caml_exceptions.create("Exn_error_pattern.A");
23
25
var B = Caml_exceptions . create ( "Exn_error_pattern.B" ) ;
24
26
25
27
function g ( match ) {
26
- if ( Caml_exceptions . isCamlExceptionOrOpenVariant ( match ) ) {
28
+ if ( Caml_exceptions . caml_is_extension ( match ) ) {
27
29
if ( match === Caml_builtin_exceptions . not_found || match [ 0 ] === Caml_builtin_exceptions . invalid_argument ) {
28
30
return 0 ;
29
31
} else if ( match [ 0 ] === Caml_builtin_exceptions . sys_error ) {
@@ -37,8 +39,46 @@ function g(match) {
37
39
38
40
}
39
41
42
+ var suites = /* record */ [ /* contents : [] */ 0 ] ;
43
+
44
+ var test_id = /* record */ [ /* contents */ 0 ] ;
45
+
46
+ function eq ( loc , x , y ) {
47
+ return Mt . eq_suites ( test_id , suites , loc , x , y ) ;
48
+ }
49
+
50
+ eq ( "File \"exn_error_pattern.ml\", line 34, characters 5-12" , f ( Caml_builtin_exceptions . not_found ) , 0 ) ;
51
+
52
+ eq ( "File \"exn_error_pattern.ml\", line 35, characters 5-12" , f ( [
53
+ Caml_builtin_exceptions . invalid_argument ,
54
+ ""
55
+ ] ) , 1 ) ;
56
+
57
+ eq ( "File \"exn_error_pattern.ml\", line 36, characters 5-12" , f ( Caml_builtin_exceptions . stack_overflow ) , 1 ) ;
58
+
59
+ eq ( "File \"exn_error_pattern.ml\", line 37, characters 5-12" , f ( [
60
+ Caml_builtin_exceptions . sys_error ,
61
+ ""
62
+ ] ) , 2 ) ;
63
+
64
+ var tmp ;
65
+
66
+ try {
67
+ throw new Error ( "x" ) ;
68
+ }
69
+ catch ( raw_e ) {
70
+ tmp = Caml_js_exceptions . internalToOCamlException ( raw_e ) ;
71
+ }
72
+
73
+ eq ( "File \"exn_error_pattern.ml\", line 38, characters 5-12" , f ( tmp ) , undefined ) ;
74
+
75
+ Mt . from_pair_suites ( "exn_error_pattern.ml" , suites [ 0 ] ) ;
76
+
40
77
exports . f = f ;
41
78
exports . A = A ;
42
79
exports . B = B ;
43
80
exports . g = g ;
44
- /* No side effect */
81
+ exports . suites = suites ;
82
+ exports . test_id = test_id ;
83
+ exports . eq = eq ;
84
+ /* Not a pure module */
0 commit comments