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 14
14
* Runtime: fix reading from the pseudo-filesystem (#1859 )
15
15
* Runtime: fix initialization of standard streams under Windows (#1849 )
16
16
* Compiler: fix stack overflow issues with double translation (#1869 )
17
+ * Lib: make the Wasm version of Json.output work with native ints and JavaScript objects (#1872 )
17
18
18
19
# 6.0.1 (2025-02-07) - Lille
19
20
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