From e4cef1a0833e6d677298600e205a142d15639bf2 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 29 Aug 2012 02:30:15 +0200 Subject: [PATCH] doc: update assert.doesNotThrow() docs It takes an optional "expected exception" argument that is not used meaningfully but is nevertheless documented. Undocument it, it confuses casual readers of the documentation. Fixes #3935. --- doc/api/assert.markdown | 2 +- lib/assert.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index c93c1e7780f..5849f6d938b 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -74,7 +74,7 @@ Custom error validation: "unexpected error" ); -## assert.doesNotThrow(block, [error], [message]) +## assert.doesNotThrow(block, [message]) Expects `block` not to throw an error, see assert.throws for details. diff --git a/lib/assert.js b/lib/assert.js index 70dc0b0eedc..f81c2034914 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -327,7 +327,7 @@ assert.throws = function(block, /*optional*/error, /*optional*/message) { }; // EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { +assert.doesNotThrow = function(block, /*optional*/message) { _throws.apply(this, [false].concat(pSlice.call(arguments))); };