Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2012e97

Browse files
committed
JS: NextJSStaticReactComponentPropsStep
1 parent 64c7d4e commit 2012e97

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

  • javascript/ql/src/semmle/javascript/frameworks

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,14 @@ module NextJS {
140140
/**
141141
* A step modelling the flow from the server-computed props object to the default exported React component that renders the page.
142142
*/
143-
class NextJSStaticReactComponentPropsStep extends DataFlow::AdditionalFlowStep,
144-
DataFlow::ValueNode {
145-
Module pageModule;
146-
ReactComponent component;
147-
148-
NextJSStaticReactComponentPropsStep() {
149-
pageModule = getAPagesModule() and
150-
this.getAstNode() = component and
151-
this = pageModule.getAnExportedValue("default").getALocalSource()
152-
}
153-
143+
class NextJSStaticReactComponentPropsStep extends DataFlow::SharedFlowStep {
154144
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
155-
pred = getAPropsSource(pageModule) and
156-
succ = component.getADirectPropsAccess()
145+
exists(Module pageModule, ReactComponent component |
146+
pageModule = getAPagesModule() and
147+
pageModule.getAnExportedValue("default").getALocalSource() = DataFlow::valueNode(component) and
148+
pred = getAPropsSource(pageModule) and
149+
succ = component.getADirectPropsAccess()
150+
)
157151
}
158152
}
159153

0 commit comments

Comments
 (0)