Skip to content

Commit 7a3f009

Browse files
committed
JS: Autoformat
1 parent c03532e commit 7a3f009

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

javascript/ql/src/experimental/Security/CWE-94/ServerSideTemplateInjection.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class SSTINunjucksSink extends ServerSideTemplateInjectionSink {
5858
}
5959

6060
class LodashTemplateSink extends ServerSideTemplateInjectionSink {
61-
LodashTemplateSink() {
62-
this = LodashUnderscore::member("template").getACall().getArgument(0)
63-
}
61+
LodashTemplateSink() { this = LodashUnderscore::member("template").getACall().getArgument(0) }
6462
}
6563

6664
from DataFlow::PathNode source, DataFlow::PathNode sink, ServerSideTemplateInjectionConfiguration c

javascript/ql/src/semmle/javascript/Promises.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ private module DynamicImportSteps {
650650
* ```js
651651
* // foo.js
652652
* export default Foo
653-
*
653+
*
654654
* // bar.js
655655
* let Foo = await import('./foo');
656656
* ```

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module FunctionCompositionCall {
5858
*
5959
* For simplicity, we model every composition function as if it supported this.
6060
*/
61-
private abstract class WithArrayOverloading extends Range {
61+
abstract private class WithArrayOverloading extends Range {
6262
/** Gets the `i`th argument to the call or the `i`th array element passed into the call. */
6363
DataFlow::Node getEffectiveArgument(int i) {
6464
result = getArgument(0).(DataFlow::ArrayCreationNode).getElement(i)
@@ -85,9 +85,7 @@ module FunctionCompositionCall {
8585
this = LodashUnderscore::member("flowRight").getACall()
8686
}
8787

88-
override DataFlow::Node getOperandNode(int i) {
89-
result = getEffectiveArgument(i)
90-
}
88+
override DataFlow::Node getOperandNode(int i) { result = getEffectiveArgument(i) }
9189
}
9290

9391
/** A call whose arguments are functions `f,g,h` which are composed into `f(g(h(...))` */

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,7 @@ private DataFlow::CallNode getAContextOutput(DataFlow::CallNode createContext) {
668668
*/
669669
private class UseMemoStep extends PreCallGraphStep {
670670
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
671-
exists(DataFlow::CallNode call |
672-
call = react().getAMemberCall("useMemo")
673-
|
671+
exists(DataFlow::CallNode call | call = react().getAMemberCall("useMemo") |
674672
pred = call.getCallback(0).getReturnNode() and
675673
succ = call
676674
)
@@ -688,9 +686,7 @@ private class ReactRouterSource extends RemoteFlowSource {
688686
this = reactRouterDom().getAMemberCall("useRouteMatch").getAPropertyRead(["params", "url"])
689687
}
690688

691-
override string getSourceType() {
692-
result = "react-router path parameters"
693-
}
689+
override string getSourceType() { result = "react-router path parameters" }
694690
}
695691

696692
/**
@@ -711,7 +707,7 @@ private predicate dependsOnReactRouter(Module mod) {
711707
* For example:
712708
* ```js
713709
* let ___location = useLocation();
714-
*
710+
*
715711
* function MyComponent(props) {
716712
* props.___location;
717713
* }

0 commit comments

Comments
 (0)