Skip to content

Commit 090037a

Browse files
TrottMylesBorins
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 0c9ea4f commit 090037a

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
@@ -290,7 +290,8 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
290290
};
291291

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

0 commit comments

Comments
 (0)