mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
fix all ql/use-string-compare
This commit is contained in:
@@ -15,7 +15,7 @@ import javascript
|
||||
from PropAccess acc, ArgumentsVariable args
|
||||
where
|
||||
acc.getBase() = args.getAnAccess() and
|
||||
acc.getPropertyName().regexpMatch("caller|callee") and
|
||||
acc.getPropertyName() = ["caller", "callee"] and
|
||||
// don't flag cases where the variable can never contain an arguments object
|
||||
not exists(Function fn | args = fn.getVariable()) and
|
||||
not exists(Parameter p | args = p.getAVariable()) and
|
||||
|
||||
@@ -50,8 +50,11 @@ from EqOrSwitch et, TypeofExpr typeof, ConstantString str
|
||||
where
|
||||
typeof = et.getAnOperand().getUnderlyingValue() and
|
||||
str = et.getAnOperand().getUnderlyingValue() and
|
||||
not str.getStringValue()
|
||||
.regexpMatch("undefined|boolean|number|string|object|function|symbol|unknown|date|bigint")
|
||||
not str.getStringValue() =
|
||||
[
|
||||
"undefined", "boolean", "number", "string", "object", "function", "symbol", "unknown", "date",
|
||||
"bigint"
|
||||
]
|
||||
select typeof,
|
||||
"The result of this 'typeof' expression is compared to '$@', but the two can never be equal.",
|
||||
str, str.getStringValue()
|
||||
|
||||
Reference in New Issue
Block a user