Files
Asger F 7bd01bf039 JS: Bulk update in UnneededDefensiveProgramming test
The history of updates to this test got messed up so just squashing
into one commit.

Some possible regressions have been accepted, but the query is strangely
opinionated so it's just hard to say what it ought to flag.
2025-02-28 13:29:33 +01:00

16 lines
344 B
JavaScript

function getDate() {
var date;
if (something()) {
date = new Date();
} else {
return null;
}
console.log(date);
return date && date.getTime(); // $ Alert[js/unneeded-defensive-code]
}
function isNotNullOrString(obj) {
return obj != null && obj != undefined && // $ Alert[js/unneeded-defensive-code]
typeof obj != 'string';
}