mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
add JS support the using keyword
This commit is contained in:
@@ -13,8 +13,9 @@
|
||||
import javascript
|
||||
import semmle.javascript.RestrictedLocations
|
||||
|
||||
from ConstDeclStmt cds, VariableDeclarator decl, VarDef def, Variable v
|
||||
from DeclStmt cds, VariableDeclarator decl, VarDef def, Variable v
|
||||
where
|
||||
(cds instanceof ConstDeclStmt or cds instanceof UsingDeclStmt) and
|
||||
decl = cds.getADecl() and
|
||||
def.getAVariable() = v and
|
||||
decl.getBindingPattern().getAVariable() = v and
|
||||
|
||||
@@ -39,6 +39,8 @@ predicate isSymbolicConstant(Variable v) {
|
||||
exists(VarDef vd | vd = getSingleDef(v) |
|
||||
vd.(VariableDeclarator).getDeclStmt() instanceof ConstDeclStmt
|
||||
or
|
||||
vd.(VariableDeclarator).getDeclStmt() instanceof UsingDeclStmt
|
||||
or
|
||||
isConstant(vd.getSource())
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user