JS: Move identityFunctionStep back into CachedSteps module

This commit is contained in:
Asger F
2025-11-19 13:47:30 +01:00
parent 8fef60464e
commit efa438a352

View File

@@ -520,23 +520,23 @@ private module CachedSteps {
predicate receiverPropWrite(Function f, string prop, DataFlow::Node rhs) {
DataFlow::thisNode(f).hasPropertyWrite(prop, rhs)
}
/**
* Holds if there is a step from `pred` to `succ` through a call to an identity function.
*/
overlay[local]
cached
predicate identityFunctionStep(DataFlow::Node pred, DataFlow::CallNode succ) {
exists(DataFlow::GlobalVarRefNode global |
global.getName() = "Object" and
succ.(DataFlow::MethodCallNode).calls(global, ["freeze", "seal"]) and
pred = succ.getArgument(0)
)
}
}
import CachedSteps
/**
* Holds if there is a step from `pred` to `succ` through a call to an identity function.
*/
overlay[local]
cached
predicate identityFunctionStep(DataFlow::Node pred, DataFlow::CallNode succ) {
exists(DataFlow::GlobalVarRefNode global |
global.getName() = "Object" and
succ.(DataFlow::MethodCallNode).calls(global, ["freeze", "seal"]) and
pred = succ.getArgument(0)
)
}
/**
* A utility class that is equivalent to `boolean` but does not require type joining.
*/