summaryrefslogtreecommitdiff
path: root/jstests/core/always_true_false.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/always_true_false.js')
-rw-r--r--jstests/core/always_true_false.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/jstests/core/always_true_false.js b/jstests/core/always_true_false.js
index 0b32ac22a16..9f6110d29e5 100644
--- a/jstests/core/always_true_false.js
+++ b/jstests/core/always_true_false.js
@@ -36,8 +36,7 @@ assert(coll.drop());
// Check that a rooted-$or query with each clause false will not return any results.
assert.commandWorked(coll.insert([{}, {}, {}]));
-const emptyOrError = assert.throws(() => coll.find({$or: []}).itcount());
-assert.eq(emptyOrError.code, ErrorCodes.BadValue);
+assert.throwsWithCode(() => coll.find({$or: []}).itcount(), ErrorCodes.BadValue);
assert.eq(coll.find({$or: [{$alwaysFalse: 1}]}).itcount(), 0);
assert.eq(coll.find({$or: [{a: {$all: []}}]}).itcount(), 0);