Skip to content

Commit 6a2f330

Browse files
Trottitaloacasas
authored andcommitted
assert: remove unneeded condition
PR-URL: #11314 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 4ffad09 commit 6a2f330

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/assert.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
294294
};
295295

296296
function expectedException(actual, expected) {
297-
if (!actual || !expected) {
297+
// actual is guaranteed to be an Error object, but we need to check expected.
298+
if (!expected) {
298299
return false;
299300
}
300301

0 commit comments

Comments
 (0)