File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,6 @@ const { getOptionValue } = require('internal/options');
94
94
95
95
let emittedSpecifierResolutionWarning = false ;
96
96
97
- const nullTypeForErr = { constructor : { name : 'null' } } ;
98
-
99
97
/**
100
98
* A utility function to iterate through a hook chain, track advancement in the
101
99
* chain, and generate and supply the `next<HookName>` argument to the custom
@@ -608,7 +606,7 @@ class ESMLoader {
608
606
throw new ERR_INVALID_RETURN_VALUE (
609
607
'an object' ,
610
608
hookErrIdentifier ,
611
- output === null ? nullTypeForErr : output ,
609
+ output ,
612
610
) ;
613
611
}
614
612
} ;
@@ -844,7 +842,7 @@ class ESMLoader {
844
842
throw new ERR_INVALID_RETURN_VALUE (
845
843
'an object' ,
846
844
hookErrIdentifier ,
847
- output === null ? nullTypeForErr : output ,
845
+ output ,
848
846
) ;
849
847
}
850
848
} ;
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ const commonArgs = [
332
332
assert . match ( stderr , / l o a d e r - r e s o l v e - n u l l - r e t u r n \. m j s / ) ;
333
333
assert . match ( stderr , / ' r e s o l v e ' h o o k ' s n e x t R e s o l v e \( \) / ) ;
334
334
assert . match ( stderr , / a n o b j e c t / ) ;
335
- assert . match ( stderr , / i n s t a n c e o f n u l l / ) ;
335
+ assert . match ( stderr , / g o t n u l l / ) ;
336
336
}
337
337
338
338
{ // Verify error thrown when invalid `context` argument passed to `nextResolve`
@@ -372,7 +372,7 @@ const commonArgs = [
372
372
assert . match ( stderr , / l o a d e r - l o a d - n u l l - r e t u r n \. m j s / ) ;
373
373
assert . match ( stderr , / ' l o a d ' h o o k ' s n e x t L o a d \( \) / ) ;
374
374
assert . match ( stderr , / a n o b j e c t / ) ;
375
- assert . match ( stderr , / i n s t a n c e o f n u l l / ) ;
375
+ assert . match ( stderr , / g o t n u l l / ) ;
376
376
}
377
377
378
378
{ // Verify error thrown when invalid `url` argument passed to `nextLoad`
You can’t perform that action at this time.
0 commit comments