Skip to content

Commit ca45fb5

Browse files
committed
JavaScript: Autoformat.
1 parent 3432304 commit ca45fb5

File tree

134 files changed

+396
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+396
-764
lines changed

javascript/ql/examples/queries/dataflow/DecodingAfterSanitization/DecodingAfterSanitizationGeneralized.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import DataFlow::PathGraph
1717
*/
1818
class DecodingCall extends CallNode {
1919
string kind;
20-
2120
Node input;
2221

2322
DecodingCall() {

javascript/ql/src/AlertSuppression.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import javascript
1212
*/
1313
class SuppressionComment extends Locatable {
1414
string text;
15-
1615
string annotation;
1716

1817
SuppressionComment() {

javascript/ql/src/AngularJS/InsecureUrlWhitelist.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ predicate isResourceUrlWhitelist(
3232
*/
3333
class ResourceUrlWhitelistEntry extends Expr {
3434
DataFlow::MethodCallNode setupCall;
35-
3635
string pattern;
3736

3837
ResourceUrlWhitelistEntry() {

javascript/ql/src/Declarations/DeadStoreOfLocal.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ where
5858
(
5959
// To avoid confusion about the meaning of "definition" and "declaration" we avoid
6060
// the term "definition" when the alert location is a variable declaration.
61-
if dead instanceof VariableDeclarator then
62-
msg = "The initial value of " + v.getName() + " is unused, since it is always overwritten."
63-
else
64-
msg = "This definition of " + v.getName() + " is useless, since its value is never read."
61+
if dead instanceof VariableDeclarator
62+
then msg = "The initial value of " + v.getName() + " is unused, since it is always overwritten."
63+
else msg = "This definition of " + v.getName() + " is useless, since its value is never read."
6564
)
6665
select dead, msg

javascript/ql/src/Declarations/DeadStoreOfProperty.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ where
160160
) and
161161
// exclude results from non-value definitions from `Object.defineProperty`
162162
(
163-
assign1 instanceof CallToObjectDefineProperty implies
163+
assign1 instanceof CallToObjectDefineProperty
164+
implies
164165
assign1.(CallToObjectDefineProperty).hasPropertyAttributeWrite("value", _)
165166
)
166167
select assign1.getWriteNode(),

javascript/ql/src/Declarations/UnusedProperty.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ predicate hasUnknownPropertyRead(LocalObject obj) {
3434
* Holds if `obj` flows to an expression that must have a specific type.
3535
*/
3636
predicate flowsToTypeRestrictedExpression(LocalObject obj) {
37-
exists (Expr restricted, TypeExpr type |
37+
exists(Expr restricted, TypeExpr type |
3838
obj.flowsToExpr(restricted) and
39-
not type.isAny() |
40-
exists (TypeAssertion assertion |
39+
not type.isAny()
40+
|
41+
exists(TypeAssertion assertion |
4142
type = assertion.getTypeAnnotation() and
4243
restricted = assertion.getExpression()
4344
)
4445
or
45-
exists (BindingPattern v |
46+
exists(BindingPattern v |
4647
type = v.getTypeAnnotation() and
4748
restricted = v.getAVariable().getAnAssignedExpr()
4849
)

javascript/ql/src/Expressions/ExprHasNoEffect.ql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ predicate isDeclaration(Expr e) {
3636
*/
3737
predicate isGetterProperty(string name) {
3838
// there is a call of the form `Object.defineProperty(..., name, descriptor)` ...
39-
exists(CallToObjectDefineProperty defProp |
40-
name = defProp.getPropertyName() |
39+
exists(CallToObjectDefineProperty defProp | name = defProp.getPropertyName() |
4140
// ... where `descriptor` defines a getter
42-
defProp.hasPropertyAttributeWrite("get", _) or
41+
defProp.hasPropertyAttributeWrite("get", _)
42+
or
4343
// ... where `descriptor` may define a getter
44-
exists (DataFlow::SourceNode descriptor |
45-
descriptor.flowsTo(defProp.getPropertyDescriptor()) |
46-
descriptor.isIncomplete(_) or
44+
exists(DataFlow::SourceNode descriptor | descriptor.flowsTo(defProp.getPropertyDescriptor()) |
45+
descriptor.isIncomplete(_)
46+
or
4747
// minimal escape analysis for the descriptor
48-
exists (DataFlow::InvokeNode invk |
48+
exists(DataFlow::InvokeNode invk |
4949
not invk = defProp and
5050
descriptor.flowsTo(invk.getAnArgument())
5151
)

javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ private predicate isBoundInMethod(MethodDeclaration method) {
2828
)
2929
or
3030
// require("auto-bind")(this)
31-
exists (string mod |
31+
exists(string mod |
3232
mod = "auto-bind" or
33-
mod = "react-autobind" |
33+
mod = "react-autobind"
34+
|
3435
thiz.flowsTo(DataFlow::moduleImport(mod).getACall().getArgument(0))
3536
)
3637
or

javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class CandidateTopLevel extends TopLevel {
1818
/** A string literal in a toplevel that contains at least one template literal. */
1919
class CandidateStringLiteral extends StringLiteral {
2020
CandidateTopLevel tl;
21-
2221
string v;
2322

2423
CandidateStringLiteral() {

javascript/ql/src/Performance/ReDoS.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ newtype TStatePair =
395395

396396
class StatePair extends TStatePair {
397397
State q1;
398-
399398
State q2;
400399

401400
StatePair() { this = MkStatePair(q1, q2) }

0 commit comments

Comments
 (0)