File tree Expand file tree Collapse file tree 4 files changed +45
-1
lines changed Expand file tree Collapse file tree 4 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,7 @@ build test/poly_variant_test.cmj : cc_cmi test/poly_variant_test.ml | test/mt.cm
494
494
build test/poly_variant_test.cmi : cc test/poly_variant_test.mli | $stdlib
495
495
build test/polymorphism_test.cmj : cc_cmi test/polymorphism_test.ml | test/polymorphism_test.cmi $stdlib
496
496
build test/polymorphism_test.cmi : cc test/polymorphism_test.mli | $stdlib
497
+ build test/polyvar_convert.cmi test/polyvar_convert.cmj : cc test/polyvar_convert.ml | $stdlib
497
498
build test/polyvar_test.cmi test/polyvar_test.cmj : cc test/polyvar_test.ml | $stdlib
498
499
build test/ppx_apply_test.cmi test/ppx_apply_test.cmj : cc test/ppx_apply_test.ml | test/mt.cmj $stdlib
499
500
build test/ppx_this_obj_field.cmi test/ppx_this_obj_field.cmj : cc test/ppx_this_obj_field.ml | test/mt.cmj $stdlib
Original file line number Diff line number Diff line change 5
5
(* "-dlambda"; *)
6
6
(* "-dtypedtree"; *)
7
7
(* "-bs-diagnose" *)
8
-
8
+ (* "-bs-diagnose"; *)
9
+ (* "-dsource"; *)
9
10
|]
10
11
}]
11
12
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+
4
+ var revData = { "x" :"a" , "b" :"b" } ;
5
+
6
+ var data = { "a" :"x" , "b" :"b" } ;
7
+
8
+ function tToJs ( x ) {
9
+ return data [ x ] ;
10
+ }
11
+
12
+ function vFromJsOpt ( s ) {
13
+ return revData [ s ] ;
14
+ }
15
+
16
+ function vFromJs ( s ) {
17
+ return revData [ s ] ;
18
+ }
19
+
20
+ exports . revData = revData ;
21
+ exports . data = data ;
22
+ exports . tToJs = tToJs ;
23
+ exports . vFromJsOpt = vFromJsOpt ;
24
+ exports . vFromJs = vFromJs ;
25
+ /* No side effect */
Original file line number Diff line number Diff line change
1
+ type t =
2
+ [ `a [@ as "x" ]
3
+ | `b ]
4
+
5
+
6
+ let revData = [% raw {| {" x" :" a" ," b" :" b" } | }]
7
+ let data = [% raw {| {" a" :" x" ," b" :" b" } | }]
8
+ external get : 'a -> 'b -> 'c = " " [@@ bs.get_index]
9
+
10
+ let tToJs (x : t ) : string =
11
+ get data x
12
+
13
+ let vFromJsOpt (s : string ) : t option =
14
+ get revData s
15
+
16
+ let vFromJs (s : string ) : t =
17
+ get revData s
You can’t perform that action at this time.
0 commit comments