Skip to content

Commit 980afb5

Browse files
committed
JS: Accept two TrivialConditional alerts
1 parent fb6b6c3 commit 980afb5

File tree

1 file changed

+2
-3
lines changed
  • javascript/ql/test/query-tests/Expressions/UnneededDefensiveProgramming

1 file changed

+2
-3
lines changed

javascript/ql/test/query-tests/Expressions/UnneededDefensiveProgramming/tst.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,12 @@
172172
if (typeof module !== "undefined" && module.exports);
173173
if (typeof global !== "undefined" && global.process);
174174

175-
u && (f(), u.p);
176-
u && (u.p, f()); // technically not OK, but it seems like an unlikely pattern
175+
u && (f(), u.p); // $ Alert[js/trivial-conditional]
176+
u && (u.p, f()); // $ Alert[js/trivial-conditional] - technically not OK, but it seems like an unlikely pattern
177177
u && !u.p; // $ Alert[js/unneeded-defensive-code]
178178
u && !u(); // $ Alert[js/unneeded-defensive-code]
179179

180180

181-
182181
function hasCallbacks(success, error) {
183182
if (success) success()
184183
if (error) error()

0 commit comments

Comments
 (0)