@@ -28,7 +28,7 @@ let s x =
28
28
if (x === undefined)
29
29
return " undefined"
30
30
if (typeof x === " function" )
31
- return " function#" + x.length
31
+ return " function#" + x.length + " # " + x.l
32
32
if (x.toString() == " [object Arguments]" )
33
33
return " (Arguments: " + Array. prototype.slice.call(x).toString() + " )" ;
34
34
return x.toString()
@@ -96,7 +96,7 @@ let%expect_test "partial application, 0 argument call is treated like 1 argument
96
96
let % expect_test _ =
97
97
let plus = Js. wrap_callback (fun a b -> a + b) in
98
98
call_and_log plus {| (function(f){ return f(1 ) }) | };
99
- [% expect {| Result : function#0 | }];
99
+ [% expect {| Result : function#0 #undefined | }];
100
100
call_and_log plus {| (function(f){ return f(1 )(2 ) }) | };
101
101
[% expect {| Result : 3 | }];
102
102
call_and_log plus {| (function(f){ return f(1 ,2 ) }) | };
@@ -147,7 +147,7 @@ let%expect_test "wrap_callback_strict" =
147
147
(Js.Unsafe. callback_with_arity 2 cb3)
148
148
{| (function(f){ return f(1 ,2 ,3 ) }) | };
149
149
[% expect {|
150
- Result : function#0 | }];
150
+ Result : function#1 # 1 | }];
151
151
call_and_log
152
152
(Js.Unsafe. callback_with_arity 2 cb3)
153
153
~cont: (fun g -> g 4 )
@@ -164,7 +164,7 @@ let%expect_test "wrap_callback_strict" =
164
164
Result : 0 | }];
165
165
call_and_log (Js.Unsafe. callback_with_arity 2 cb3) {| (function(f){ return f(1 ,2 ) }) | };
166
166
[% expect {|
167
- Result : function#0 | }]
167
+ Result : function#1 # 1 | }]
168
168
169
169
let % expect_test " wrap_callback_strict" =
170
170
call_and_log
@@ -238,7 +238,7 @@ let%expect_test "partial application, 0 argument call is treated 1 argument (und
238
238
let % expect_test _ =
239
239
let plus = Js. wrap_meth_callback (fun _ a b -> a + b) in
240
240
call_and_log plus {| (function(f){ return f(1 ) }) | };
241
- [% expect {| Result : function#0 | }];
241
+ [% expect {| Result : function#0 #undefined | }];
242
242
call_and_log plus {| (function(f){ return f(1 )(2 ) }) | };
243
243
[% expect {| Result : 3 | }];
244
244
call_and_log plus {| (function(f){ return f(1 ,2 ) }) | };
@@ -291,7 +291,7 @@ let%expect_test "wrap_meth_callback_strict" =
291
291
(Js.Unsafe. meth_callback_with_arity 2 cb4)
292
292
{| (function(f){ return f.apply(" this" ,[1 ,2 ,3 ]) }) | };
293
293
[% expect {|
294
- Result : function#0 | }];
294
+ Result : function#1 # 1 | }];
295
295
call_and_log
296
296
(Js.Unsafe. meth_callback_with_arity 2 cb4)
297
297
~cont: (fun g -> g 4 )
@@ -309,7 +309,7 @@ let%expect_test "wrap_meth_callback_strict" =
309
309
call_and_log
310
310
(Js.Unsafe. meth_callback_with_arity 2 cb4)
311
311
{| (function(f){ return f.apply(" this" ,[1 ,2 ]) }) | };
312
- [% expect {| Result : function#0 | }]
312
+ [% expect {| Result : function#1 # 1 | }]
313
313
314
314
let % expect_test " wrap_meth_callback_strict" =
315
315
call_and_log
@@ -354,7 +354,7 @@ let%expect_test "partial application, extra arguments set to undefined" =
354
354
let % expect_test _ =
355
355
call_and_log cb3 ~cont: (fun g -> g 1 ) {| (function(f){ return f }) | };
356
356
[% expect {|
357
- Result : function#0 | }]
357
+ Result : function#2 # 2 | }]
358
358
359
359
let % expect_test _ =
360
360
call_and_log cb3 ~cont: (fun g -> g 1 2 3 4 ) {| (function(f){ return f }) | };
@@ -369,7 +369,7 @@ let%expect_test _ =
369
369
| _ -> Printf. printf " Error: unknown"
370
370
in
371
371
f cb5;
372
- [% expect {| Result : function#0 | }];
372
+ [% expect {| Result : function#1 # 1 | }];
373
373
f cb4;
374
374
[% expect {|
375
375
got 1 , 1 , 2 , 3 , done
@@ -399,7 +399,7 @@ let%expect_test _ =
399
399
Result : 0 | }];
400
400
f (Obj. magic cb4);
401
401
[% expect {|
402
- Result : function#0 | }];
402
+ Result : function#1 # 1 | }];
403
403
f (Obj. magic cb5);
404
404
[% expect {|
405
- Result : function#0 | }]
405
+ Result : function#2 # 2 | }]
0 commit comments