Skip to content

Commit d52ff3e

Browse files
committed
JS: Autoformat and add qldoc
1 parent 96c6e4d commit d52ff3e

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ module TaintTracking {
312312
*/
313313
cached
314314
private module Cached {
315-
cached predicate forceStage() {
316-
Stages::Taint::ref()
317-
}
315+
cached
316+
predicate forceStage() { Stages::Taint::ref() }
318317

319318
/**
320319
* Holds if `pred` → `succ` should be considered a taint-propagating
@@ -963,7 +962,8 @@ module TaintTracking {
963962
getACaptureSetter(pred) = getANodeReachingCaptureRef(succ)
964963
or
965964
exists(StringReplaceCall replace |
966-
getANodeReachingCaptureRef(succ) = replace.getReplacementCallback().getFunction().getEntry() and
965+
getANodeReachingCaptureRef(succ) =
966+
replace.getReplacementCallback().getFunction().getEntry() and
967967
pred = replace.getReceiver()
968968
)
969969
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ private newtype TUnit = MkUnit()
44
* A class with only one instance.
55
*/
66
class Unit extends TUnit {
7+
/** Gets a textual representation of this element. */
78
final string toString() { result = "Unit" }
89
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,9 @@ module Angular2 {
590590
private class MatTableDataSourceStep extends TaintTracking::SharedTaintStep {
591591
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
592592
exists(DataFlow::NewNode invoke |
593-
invoke = DataFlow::moduleMember("@angular/material/table", "MatTableDataSource").getAnInstantiation() and
593+
invoke =
594+
DataFlow::moduleMember("@angular/material/table", "MatTableDataSource")
595+
.getAnInstantiation() and
594596
pred = [invoke.getArgument(0), invoke.getAPropertyWrite("data").getRhs()] and
595597
succ = invoke
596598
)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ private class PlainStep extends TaintTracking::SharedTaintStep {
2424
private class BindStep extends TaintTracking::SharedTaintStep {
2525
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
2626
exists(DataFlow::CallNode bind | bind = classnames().getAMemberCall("bind") |
27-
pred = [succ.(DataFlow::CallNode).getAnArgument(), bind.getAnArgument(), bind.getOptionArgument(_, _)] and
27+
pred =
28+
[
29+
succ.(DataFlow::CallNode).getAnArgument(), bind.getAnArgument(),
30+
bind.getOptionArgument(_, _)
31+
] and
2832
succ = bind.getACall()
2933
)
3034
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ module FunctionCompositionCall {
112112

113113
private class ComposedFunctionTaintStep extends TaintTracking::SharedTaintStep {
114114
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
115-
exists(int fnIndex, DataFlow::FunctionNode fn, FunctionCompositionCall composed, DataFlow::CallNode call |
115+
exists(
116+
int fnIndex, DataFlow::FunctionNode fn, FunctionCompositionCall composed,
117+
DataFlow::CallNode call
118+
|
116119
fn = composed.getOperandFunction(fnIndex) and
117120
call = composed.getACall()
118121
|

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ module Vue {
307307
private DataFlow::PropWrite getAPropertyValueWrite(string name) {
308308
result = getData().getALocalSource().getAPropertyWrite(name)
309309
or
310-
result = getABoundFunction().getALocalSource().(DataFlow::FunctionNode).getReceiver().getAPropertyWrite(name)
310+
result =
311+
getABoundFunction()
312+
.getALocalSource()
313+
.(DataFlow::FunctionNode)
314+
.getReceiver()
315+
.getAPropertyWrite(name)
311316
}
312317

313318
/**

0 commit comments

Comments
 (0)