File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 9
9
* Runtime: refactor caml_xmlhttprequest_create implementation (#1846 )
10
10
* Runtime: update constant imports to use ` node:fs ` module (#1850 )
11
11
* Runtime: make Obj.dup work with floats and boxed numbers (#1871 )
12
+ * Lib: make the Wasm version of Json.output work with native ints and JavaScript objects (#1872 )
12
13
13
14
## Bug fixes
14
15
* Runtime: fix path normalization (#1848 )
Original file line number Diff line number Diff line change @@ -116,9 +116,9 @@ let rec write b v =
116
116
write_int64 b i
117
117
| id -> failwith (Printf. sprintf " Json.output: unsupported custom value %s " id)
118
118
else if t = Obj. abstract_tag
119
- then
120
- (* Presumably a JavaScript value *)
121
- Buffer. add_string b (Js. to_string (json##stringify v))
119
+ then
120
+ (* Presumably a JavaScript value *)
121
+ Buffer. add_string b (Js. to_string (json##stringify v))
122
122
else failwith (Printf. sprintf " Json.output: unsupported tag %d " t)
123
123
124
124
let to_json v =
Original file line number Diff line number Diff line change @@ -63,7 +63,13 @@ let%expect_test _ =
63
63
[% expect {| 2 | }]
64
64
65
65
let % expect_test " JavaScript object" =
66
- let x = object % js val x = 1 val y = Js. string " abcd" end in
66
+ let x =
67
+ object % js
68
+ val x = 1
69
+
70
+ val y = Js. string " abcd"
71
+ end
72
+ in
67
73
let s = Json. output x in
68
74
let s1 = Js. to_string s in
69
75
Printf. printf " %s\n " s1;
You can’t perform that action at this time.
0 commit comments