Skip to content

Commit 3f30564

Browse files
committed
JS: Autoformat
1 parent f49b36a commit 3f30564

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

javascript/ql/src/semmle/javascript/CFG.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ class ControlFlowNode extends @cfg_node, Locatable, NodeInStmtContainer {
311311
* Holds if this is a final node, that is, a CFG node where execution of a
312312
* toplevel or function terminates.
313313
*/
314-
final predicate isAFinalNode() {
315-
isAFinalNodeOfContainer(_)
316-
}
314+
final predicate isAFinalNode() { isAFinalNodeOfContainer(_) }
317315

318316
/**
319317
* Holds if this node is unreachable, that is, it has no predecessors in the CFG.
@@ -371,7 +369,9 @@ class ControlFlowEntryNode extends SyntheticControlFlowNode, @entry_node {
371369

372370
/** A synthetic CFG node marking the exit of a function or toplevel script. */
373371
class ControlFlowExitNode extends SyntheticControlFlowNode, @exit_node {
374-
override predicate isAFinalNodeOfContainer(StmtContainer container) { exit_cfg_node(this, container) }
372+
override predicate isAFinalNodeOfContainer(StmtContainer container) {
373+
exit_cfg_node(this, container)
374+
}
375375

376376
override string toString() { result = "exit node of " + getContainer().toString() }
377377
}

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,7 @@ module DataFlow {
12251225
/**
12261226
* INTERNAL: Use `parameterNode(Parameter)` instead.
12271227
*/
1228-
predicate parameterNode(DataFlow::Node nd, Parameter p) {
1229-
nd = valueNode(p)
1230-
}
1228+
predicate parameterNode(DataFlow::Node nd, Parameter p) { nd = valueNode(p) }
12311229

12321230
/**
12331231
* INTERNAL: Use `thisNode(StmtContainer container)` instead.

javascript/ql/src/semmle/javascript/dataflow/TypeInference.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ class AnalyzedFunction extends DataFlow::AnalyzedValueNode {
263263
* of functions that cannot actually complete normally, since it does not
264264
* account for `finally` blocks and does not check reachability.
265265
*/
266-
private predicate mayReturnImplicitly() {
267-
terminalNode(astNode, any(ExprOrStmt st))
268-
}
266+
private predicate mayReturnImplicitly() { terminalNode(astNode, any(ExprOrStmt st)) }
269267
}
270268

271269
pragma[noinline]

javascript/ql/src/semmle/javascript/dataflow/internal/BasicExprTypeInference.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ private PrimitiveType getAnAddOperandPrimitiveType(Expr e, int n) {
265265
* Holds if `e` is a `+` or `+=` expression that could be interpreted as a string append
266266
* (as opposed to a numeric addition) at runtime.
267267
*/
268-
private predicate isStringAppend(Expr e) {
269-
getAnAddOperandPrimitiveType(e, _) = TTString()
270-
}
268+
private predicate isStringAppend(Expr e) { getAnAddOperandPrimitiveType(e, _) = TTString() }
271269

272270
/**
273271
* Holds if `e` is a `+` or `+=` expression that could be interpreted as a numeric addition

javascript/ql/src/semmle/javascript/dataflow/internal/DataFlowNode.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* Contains the raw data type underlying `DataFlow::Node`.
55
*/
6+
67
private import javascript
78

89
/**

javascript/ql/src/semmle/javascript/dataflow/internal/FlowSteps.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ private module CachedSteps {
9292
cached
9393
predicate calls(DataFlow::InvokeNode invk, Function f) { f = invk.getACallee(0) }
9494

95-
private predicate callsBoundInternal(DataFlow::InvokeNode invk, Function f, int boundArgs, boolean contextDependent) {
96-
CallGraph::getABoundFunctionReference(f.flow(), boundArgs, contextDependent).flowsTo(invk.getCalleeNode())
95+
private predicate callsBoundInternal(
96+
DataFlow::InvokeNode invk, Function f, int boundArgs, boolean contextDependent
97+
) {
98+
CallGraph::getABoundFunctionReference(f.flow(), boundArgs, contextDependent)
99+
.flowsTo(invk.getCalleeNode())
97100
}
98101

99102
/**

javascript/ql/src/semmle/javascript/frameworks/NodeJSLib.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import semmle.javascript.frameworks.HTTP
77
import semmle.javascript.security.SensitiveActions
88

99
module NodeJSLib {
10-
private GlobalVariable processVariable() {
11-
variables(result, "process", any(GlobalScope sc))
12-
}
10+
private GlobalVariable processVariable() { variables(result, "process", any(GlobalScope sc)) }
1311

1412
pragma[nomagic]
1513
private GlobalVarAccess processExprInTopLevel(TopLevel tl) {
@@ -27,9 +25,7 @@ module NodeJSLib {
2725
* an import of the `process` module.
2826
*/
2927
private class ImplicitProcessImport extends DataFlow::ModuleImportNode::Range {
30-
ImplicitProcessImport() {
31-
this = DataFlow::exprNode(processExprInNodeModule())
32-
}
28+
ImplicitProcessImport() { this = DataFlow::exprNode(processExprInNodeModule()) }
3329

3430
override string getPath() { result = "process" }
3531
}

0 commit comments

Comments
 (0)