From c769bac2c3237d1d9a096b88943c03dbd8a88b83 Mon Sep 17 00:00:00 2001 From: Miguel Angel Asencio Hurtado Date: Wed, 12 Oct 2016 09:37:44 +0200 Subject: [PATCH] assert: name anonymous functions Ref: https://github.com/nodejs/node/issues/8913 --- lib/assert.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 0458bb09816872..04c5cb5ad436e1 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -359,13 +359,14 @@ function _throws(shouldThrow, block, expected, message) { // 11. Expected to throw an error: // assert.throws(block, Error_opt, message_opt); -assert.throws = function(block, /*optional*/error, /*optional*/message) { +assert.throws = function throws(block, /*optional*/error, /*optional*/message) { _throws(true, block, error, message); }; // EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { +assert.doesNotThrow = doesNotThrow; +function doesNotThrow(block, /*optional*/error, /*optional*/message) { _throws(false, block, error, message); -}; +} -assert.ifError = function(err) { if (err) throw err; }; +assert.ifError = function ifError(err) { if (err) throw err; };