Skip to content

Commit ef030da

Browse files
maasenciohjasnell
authored andcommitted
assert: name anonymous functions
Ref: #8913 PR-URL: #9051 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1aa15da commit ef030da

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎lib/assert.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,14 @@ function _throws(shouldThrow, block, expected, message){
359359
// 11. Expected to throw an error:
360360
// assert.throws(block, Error_opt, message_opt);
361361

362-
assert.throws=function(block,/*optional*/error,/*optional*/message){
362+
assert.throws=functionthrows(block,/*optional*/error,/*optional*/message){
363363
_throws(true,block,error,message);
364364
};
365365

366366
// EXTENSION! This is annoying to write outside this module.
367-
assert.doesNotThrow=function(block,/*optional*/error,/*optional*/message){
367+
assert.doesNotThrow=doesNotThrow;
368+
functiondoesNotThrow(block,/*optional*/error,/*optional*/message){
368369
_throws(false,block,error,message);
369-
};
370+
}
370371

371-
assert.ifError=function(err){if(err)throwerr;};
372+
assert.ifError=functionifError(err){if(err)throwerr;};

0 commit comments

Comments
(0)