Skip to content

Commit c769bac

Browse files
committed
assert: name anonymous functions
Ref: #8913
1 parent 774d737 commit c769bac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/assert.js

+5-4
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 = function throws(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+
function doesNotThrow(block, /*optional*/error, /*optional*/message) {
368369
_throws(false, block, error, message);
369-
};
370+
}
370371

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

0 commit comments

Comments
 (0)