From 6a2f330dbd3d68e7c75826bdc3bef57e67e5a114 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 10 Feb 2017 23:45:03 -0800 Subject: [PATCH] assert: remove unneeded condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/11314 Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Michael Dawson --- lib/assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/assert.js b/lib/assert.js index 7f69ba0c60e476..baecb38d4f33d8 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -294,7 +294,8 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) { }; function expectedException(actual, expected) { - if (!actual || !expected) { + // actual is guaranteed to be an Error object, but we need to check expected. + if (!expected) { return false; }