JS: Autoformat

This commit is contained in:
Asger Feldthaus
2020-05-04 17:04:59 +01:00
parent f51e846439
commit 926e79d272
3 changed files with 9 additions and 14 deletions

View File

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

View File

@@ -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())
}
/**

View File

@@ -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) }
}