Skip to content

Commit 32b264c

Browse files
TrottMylesBorins
authored andcommitted
assert: remove unneeded condition
PR-URL: #11314 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 10a497c commit 32b264c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/assert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
291291
};
292292

293293
function expectedException(actual, expected) {
294-
if (!actual || !expected) {
294+
// actual is guaranteed to be an Error object, but we need to check expected.
295+
if (!expected) {
295296
return false;
296297
}
297298

0 commit comments

Comments
 (0)