mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
JS: Autoformat
This commit is contained in:
@@ -115,9 +115,7 @@ module Closure {
|
||||
override DefaultClosureModuleDeclaration range;
|
||||
}
|
||||
|
||||
private GlobalVariable googVariable() {
|
||||
variables(result, "goog", any(GlobalScope sc))
|
||||
}
|
||||
private GlobalVariable googVariable() { variables(result, "goog", any(GlobalScope sc)) }
|
||||
|
||||
pragma[nomagic]
|
||||
private MethodCallExpr googModuleDeclExpr() {
|
||||
@@ -135,9 +133,7 @@ module Closure {
|
||||
* A module using the Closure module system, declared using `goog.module()` or `goog.declareModuleId()`.
|
||||
*/
|
||||
class ClosureModule extends Module {
|
||||
ClosureModule() {
|
||||
exists(googModuleDeclExprInContainer(this))
|
||||
}
|
||||
ClosureModule() { exists(googModuleDeclExprInContainer(this)) }
|
||||
|
||||
/**
|
||||
* Gets the call to `goog.module` or `goog.declareModuleId` in this module.
|
||||
|
||||
@@ -249,13 +249,15 @@ class Expr extends @expr, ExprOrStmt, ExprOrType, AST::ValueNode {
|
||||
result = getCatchParameterFromStmt(getRawEnclosingStmt(this))
|
||||
or
|
||||
not exists(getCatchParameterFromStmt(getRawEnclosingStmt(this))) and
|
||||
result = any(DataFlow::FunctionNode f | f.getFunction() = this.getContainer()).getExceptionalReturn()
|
||||
result =
|
||||
any(DataFlow::FunctionNode f | f.getFunction() = this.getContainer()).getExceptionalReturn()
|
||||
}
|
||||
}
|
||||
|
||||
cached
|
||||
private DataFlow::Node getCatchParameterFromStmt(Stmt stmt) {
|
||||
result = DataFlow::parameterNode(stmt.getEnclosingTryCatchStmt().getACatchClause().getAParameter())
|
||||
result =
|
||||
DataFlow::parameterNode(stmt.getEnclosingTryCatchStmt().getACatchClause().getAParameter())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Provides predicates and classes for relating nodes to their
|
||||
* enclosing `StmtContainer`.
|
||||
*/
|
||||
|
||||
private import javascript
|
||||
|
||||
cached
|
||||
@@ -13,9 +14,7 @@ private StmtContainer getStmtContainer(@node_in_stmt_container node) {
|
||||
stmtContainers(node, result)
|
||||
or
|
||||
// Properties
|
||||
exists(ASTNode parent |
|
||||
properties(node, parent, _, _, _)
|
||||
|
|
||||
exists(ASTNode parent | properties(node, parent, _, _, _) |
|
||||
exprContainers(parent, result)
|
||||
or
|
||||
stmtContainers(parent, result)
|
||||
@@ -46,7 +45,5 @@ class NodeInStmtContainer extends Locatable, @node_in_stmt_container {
|
||||
* Gets the function or toplevel to which this node belongs.
|
||||
*/
|
||||
pragma[inline]
|
||||
final StmtContainer getContainer() {
|
||||
result = getStmtContainer(this)
|
||||
}
|
||||
final StmtContainer getContainer() { result = getStmtContainer(this) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user