JavaScript: Autoformat all QL files.

This commit is contained in:
Max Schaefer
2019-01-07 10:15:45 +00:00
parent aa6b89dc34
commit 31bb39a810
380 changed files with 9957 additions and 13923 deletions

View File

@@ -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 + "."