mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
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.
16 lines
344 B
JavaScript
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';
|
|
}
|