JS: address review comments

This commit is contained in:
Esben Sparre Andreasen
2018-08-22 13:54:07 +02:00
parent fef257b1ec
commit 218c0cb51a
2 changed files with 6 additions and 5 deletions

View File

@@ -108,13 +108,13 @@ module TypeConfusionThroughParameterTampering {
read.asExpr() = cond.getTest()
)
or
exists (EqualityTest eq, Expr zero |
exists (Comparison cmp, Expr zero |
zero.getIntValue() = 0 and
eq.hasOperands(read.asExpr(), zero)
cmp.hasOperands(read.asExpr(), zero)
)
or
exists (LogNotExpr eq |
eq.getOperand() = read.asExpr()
exists (LogNotExpr neg |
neg.getOperand() = read.asExpr()
)
)
)

View File

@@ -54,7 +54,8 @@ express().get('/some/path/:foo', function(req, res) {
express().get('/some/path/:foo', function(req, res) {
if (req.query.path.length) {} // OK
req.query.path.length == 0; // OK
!req.query.path.length == 0; // OK
!req.query.path.length; // OK
req.query.path.length > 0; // OK
});
express().get('/some/path/:foo', function(req, res) {