@@ -13,22 +13,21 @@ function myMultiArgFunc(arg1, arg2, arg3) {
1313 return 42 ;
1414}
1515
16- assert . strictEqual ( 42 , makeCallback ( process , common . mustCall ( function ( ) {
16+ assert . strictEqual ( makeCallback ( process , common . mustCall ( function ( ) {
1717 assert . strictEqual ( 0 , arguments . length ) ;
1818 assert . strictEqual ( this , process ) ;
1919 return 42 ;
20- } ) ) ) ;
20+ } ) ) , 42 ) ;
2121
22- assert . strictEqual ( 42 , makeCallback ( process , common . mustCall ( function ( x ) {
23- assert . strictEqual ( 1 , arguments . length ) ;
22+ assert . strictEqual ( makeCallback ( process , common . mustCall ( function ( x ) {
23+ assert . strictEqual ( arguments . length , 1 ) ;
2424 assert . strictEqual ( this , process ) ;
2525 assert . strictEqual ( x , 1337 ) ;
2626 return 42 ;
27- } ) , 1337 ) ) ;
27+ } ) , 1337 ) , 42 ) ;
2828
29- assert . strictEqual ( 42 ,
30- makeCallback ( this ,
31- common . mustCall ( myMultiArgFunc ) , 1 , 2 , 3 ) ) ;
29+ assert . strictEqual ( makeCallback ( this ,
30+ common . mustCall ( myMultiArgFunc ) , 1 , 2 , 3 ) , 42 ) ;
3231
3332// TODO(node-api): napi_make_callback needs to support
3433// strings passed for the func argument
@@ -47,12 +46,12 @@ const recv = {
4746 }),
4847};
4948
50- assert.strictEqual(42, makeCallback(recv, 'one'));
51- assert.strictEqual(42, makeCallback(recv, 'two', 1337));
49+ assert.strictEqual(makeCallback(recv, 'one'), 42 );
50+ assert.strictEqual(makeCallback(recv, 'two', 1337), 42 );
5251
5352// Check that callbacks on a receiver from a different context works.
5453const foreignObject = vm.runInNewContext('({ fortytwo() { return 42; } })');
55- assert.strictEqual(42, makeCallback(foreignObject, 'fortytwo'));
54+ assert.strictEqual(makeCallback(foreignObject, 'fortytwo'), 42 );
5655*/
5756
5857// Check that the callback is made in the context of the receiver.
@@ -63,7 +62,7 @@ const target = vm.runInNewContext(`
6362 return Object;
6463 })
6564` ) ;
66- assert . notStrictEqual ( Object , makeCallback ( process , target , Object ) ) ;
65+ assert . notStrictEqual ( makeCallback ( process , target , Object ) , Object ) ;
6766
6867// Runs in inner context.
6968const forward = vm . runInNewContext ( `
@@ -79,4 +78,4 @@ function endpoint($Object) {
7978 return Object ;
8079}
8180
82- assert . strictEqual ( Object , makeCallback ( process , forward , endpoint ) ) ;
81+ assert . strictEqual ( makeCallback ( process , forward , endpoint ) , Object ) ;
0 commit comments