Skip to content

Commit efa438a

Browse files
committed
JS: Move identityFunctionStep back into CachedSteps module
1 parent 8fef604 commit efa438a

File tree

1 file changed

+13
-13
lines changed
  • javascript/ql/lib/semmle/javascript/dataflow/internal

1 file changed

+13
-13
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSteps.qll

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -520,23 +520,23 @@ private module CachedSteps {
520520
predicate receiverPropWrite(Function f, string prop, DataFlow::Node rhs) {
521521
DataFlow::thisNode(f).hasPropertyWrite(prop, rhs)
522522
}
523+
524+
/**
525+
* Holds if there is a step from `pred` to `succ` through a call to an identity function.
526+
*/
527+
overlay[local]
528+
cached
529+
predicate identityFunctionStep(DataFlow::Node pred, DataFlow::CallNode succ) {
530+
exists(DataFlow::GlobalVarRefNode global |
531+
global.getName() = "Object" and
532+
succ.(DataFlow::MethodCallNode).calls(global, ["freeze", "seal"]) and
533+
pred = succ.getArgument(0)
534+
)
535+
}
523536
}
524537

525538
import CachedSteps
526539

527-
/**
528-
* Holds if there is a step from `pred` to `succ` through a call to an identity function.
529-
*/
530-
overlay[local]
531-
cached
532-
predicate identityFunctionStep(DataFlow::Node pred, DataFlow::CallNode succ) {
533-
exists(DataFlow::GlobalVarRefNode global |
534-
global.getName() = "Object" and
535-
succ.(DataFlow::MethodCallNode).calls(global, ["freeze", "seal"]) and
536-
pred = succ.getArgument(0)
537-
)
538-
}
539-
540540
/**
541541
* A utility class that is equivalent to `boolean` but does not require type joining.
542542
*/

0 commit comments

Comments
 (0)