@@ -10,8 +10,8 @@ const makeCallback = binding.makeCallback;
1010const mustCallCheckDomains = common . mustCall ( checkDomains ) ;
1111
1212// Make sure that using MakeCallback allows the error to propagate.
13- assert . throws ( function ( ) {
14- makeCallback ( { } , function ( ) {
13+ assert . throws ( ( ) => {
14+ makeCallback ( { } , ( ) => {
1515throw new Error ( 'hi from domain error' ) ;
1616} ) ;
1717} , / ^ E r r o r : h i f r o m d o m a i n e r r o r $ / ) ;
@@ -27,22 +27,22 @@ assert.throws(function(){
2727
2828// Processing of the MicrotaskQueue is manually handled by node. They are not
2929// processed until after the nextTickQueue has been processed.
30- Promise . resolve ( 1 ) . then ( common . mustCall ( function ( ) {
30+ Promise . resolve ( 1 ) . then ( common . mustCall ( ( ) => {
3131results . push ( 7 ) ;
3232} ) ) ;
3333
3434// The nextTick should run after all immediately invoked calls.
35- process . nextTick ( common . mustCall ( function ( ) {
35+ process . nextTick ( common . mustCall ( ( ) => {
3636results . push ( 3 ) ;
3737
3838// Run same test again but while processing the nextTickQueue to make sure
3939// the following MakeCallback call breaks in the middle of processing the
4040// queue and allows the script to run normally.
41- process . nextTick ( common . mustCall ( function ( ) {
41+ process . nextTick ( common . mustCall ( ( ) => {
4242results . push ( 6 ) ;
4343} ) ) ;
4444
45- makeCallback ( { } , common . mustCall ( function ( ) {
45+ makeCallback ( { } , common . mustCall ( ( ) => {
4646results . push ( 4 ) ;
4747} ) ) ;
4848
@@ -54,7 +54,7 @@ assert.throws(function(){
5454// MakeCallback is calling the function immediately, but should then detect
5555// that a script is already in the middle of execution and return before
5656// either the nextTickQueue or MicrotaskQueue are processed.
57- makeCallback ( { } , common . mustCall ( function ( ) {
57+ makeCallback ( { } , common . mustCall ( ( ) => {
5858results . push ( 1 ) ;
5959} ) ) ;
6060
@@ -63,7 +63,7 @@ assert.throws(function(){
6363// and process them immediately.
6464results . push ( 2 ) ;
6565
66- setImmediate ( common . mustCall ( function ( ) {
66+ setImmediate ( common . mustCall ( ( ) => {
6767for ( let i = 0 ; i < results . length ; i ++ ) {
6868assert . strictEqual ( results [ i ] , i ,
6969`verifyExecutionOrder(${ arg } ) results: ${ results } ` ) ;
@@ -72,14 +72,14 @@ assert.throws(function(){
7272// The tests are first run on bootstrap during LoadEnvironment() in
7373// src/node.cc. Now run the tests through node::MakeCallback().
7474setImmediate ( function ( ) {
75- makeCallback ( { } , common . mustCall ( function ( ) {
75+ makeCallback ( { } , common . mustCall ( ( ) => {
7676verifyExecutionOrder ( 2 ) ;
7777} ) ) ;
7878} ) ;
7979} else if ( arg === 2 ) {
8080// Make sure there are no conflicts using node::MakeCallback()
8181// within timers.
82- setTimeout ( common . mustCall ( function ( ) {
82+ setTimeout ( common . mustCall ( ( ) => {
8383verifyExecutionOrder ( 3 ) ;
8484} ) , 10 ) ;
8585} else if ( arg === 3 ) {
@@ -94,16 +94,16 @@ assert.throws(function(){
9494function checkDomains ( ) {
9595// Check that domains are properly entered/exited when called in multiple
9696// levels from both node::MakeCallback() and AsyncWrap::MakeCallback
97- setImmediate ( common . mustCall ( function ( ) {
97+ setImmediate ( common . mustCall ( ( ) => {
9898const d1 = domain . create ( ) ;
9999const d2 = domain . create ( ) ;
100100const d3 = domain . create ( ) ;
101101
102- makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
102+ makeCallback ( { domain : d1 } , common . mustCall ( ( ) => {
103103assert . strictEqual ( d1 , process . domain ) ;
104- makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
104+ makeCallback ( { domain : d2 } , common . mustCall ( ( ) => {
105105assert . strictEqual ( d2 , process . domain ) ;
106- makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
106+ makeCallback ( { domain : d3 } , common . mustCall ( ( ) => {
107107assert . strictEqual ( d3 , process . domain ) ;
108108} ) ) ;
109109assert . strictEqual ( d2 , process . domain ) ;
@@ -112,16 +112,16 @@ function checkDomains(){
112112} ) ) ;
113113} ) ) ;
114114
115- setTimeout ( common . mustCall ( function ( ) {
115+ setTimeout ( common . mustCall ( ( ) => {
116116const d1 = domain . create ( ) ;
117117const d2 = domain . create ( ) ;
118118const d3 = domain . create ( ) ;
119119
120- makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
120+ makeCallback ( { domain : d1 } , common . mustCall ( ( ) => {
121121assert . strictEqual ( d1 , process . domain ) ;
122- makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
122+ makeCallback ( { domain : d2 } , common . mustCall ( ( ) => {
123123assert . strictEqual ( d2 , process . domain ) ;
124- makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
124+ makeCallback ( { domain : d3 } , common . mustCall ( ( ) => {
125125assert . strictEqual ( d3 , process . domain ) ;
126126} ) ) ;
127127assert . strictEqual ( d2 , process . domain ) ;
@@ -134,10 +134,10 @@ function checkDomains(){
134134// Make sure nextTick, setImmediate and setTimeout can all recover properly
135135// after a thrown makeCallback call.
136136const d = domain . create ( ) ;
137- d . on ( 'error' , common . mustCall ( function ( e ) {
137+ d . on ( 'error' , common . mustCall ( ( e ) => {
138138assert . strictEqual ( e . message , `throw from domain ${ id } ` ) ;
139139} ) ) ;
140- makeCallback ( { domain : d } , function ( ) {
140+ makeCallback ( { domain : d } , ( ) => {
141141throw new Error ( `throw from domain ${ id } ` ) ;
142142} ) ;
143143throw new Error ( 'UNREACHABLE' ) ;
0 commit comments