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

Skip to content

Commit 64c7d4e

Browse files
committed
JS: NextJSStaticPropsStep
1 parent 0035def commit 64c7d4e

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

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

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,14 @@ module NextJS {
126126
/**
127127
* A step modelling the flow from the server-computed props object to the default exported function that renders the page.
128128
*/
129-
class NextJSStaticPropsStep extends DataFlow::AdditionalFlowStep, DataFlow::FunctionNode {
130-
Module pageModule;
131-
132-
NextJSStaticPropsStep() {
133-
pageModule = getAPagesModule() and
134-
this = pageModule.getAnExportedValue("default").getAFunctionValue()
135-
}
136-
129+
class NextJSStaticPropsStep extends DataFlow::SharedFlowStep {
137130
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
138-
pred = getAPropsSource(pageModule) and
139-
succ = this.getParameter(0)
131+
exists(Module pageModule, DataFlow::FunctionNode function |
132+
pageModule = getAPagesModule() and
133+
function = pageModule.getAnExportedValue("default").getAFunctionValue() and
134+
pred = getAPropsSource(pageModule) and
135+
succ = function.getParameter(0)
136+
)
140137
}
141138
}
142139

0 commit comments

Comments
 (0)