mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
JavaScript: Autoformat all QL files.
This commit is contained in:
@@ -18,16 +18,19 @@ import javascript
|
||||
* code; `baseDesc` is a description of `baseVal` used in the alert message.
|
||||
*/
|
||||
predicate illegalPropAccess(AbstractValue baseVal, string baseDesc, string prop) {
|
||||
baseVal instanceof AbstractArguments and baseDesc = "arguments" and
|
||||
baseVal instanceof AbstractArguments and
|
||||
baseDesc = "arguments" and
|
||||
(prop = "caller" or prop = "callee")
|
||||
or
|
||||
baseVal instanceof AbstractFunction and baseDesc = "Function.prototype" and
|
||||
baseVal instanceof AbstractFunction and
|
||||
baseDesc = "Function.prototype" and
|
||||
(prop = "caller" or prop = "arguments")
|
||||
}
|
||||
|
||||
from PropAccess acc, DataFlow::AnalyzedNode baseNode, string base, string prop
|
||||
where acc.accesses(baseNode.asExpr(), prop) and
|
||||
acc.getContainer().isStrict() and
|
||||
illegalPropAccess(baseNode.getAValue(), base, prop) and
|
||||
forex (AbstractValue av | av = baseNode.getAValue() | illegalPropAccess(av, _, prop))
|
||||
select acc, "Strict mode code cannot use " + base + "." + prop + "."
|
||||
where
|
||||
acc.accesses(baseNode.asExpr(), prop) and
|
||||
acc.getContainer().isStrict() and
|
||||
illegalPropAccess(baseNode.getAValue(), base, prop) and
|
||||
forex(AbstractValue av | av = baseNode.getAValue() | illegalPropAccess(av, _, prop))
|
||||
select acc, "Strict mode code cannot use " + base + "." + prop + "."
|
||||
|
||||
Reference in New Issue
Block a user