mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: Move identityFunctionStep back into CachedSteps module
This commit is contained in:
@@ -520,23 +520,23 @@ private module CachedSteps {
|
|||||||
predicate receiverPropWrite(Function f, string prop, DataFlow::Node rhs) {
|
predicate receiverPropWrite(Function f, string prop, DataFlow::Node rhs) {
|
||||||
DataFlow::thisNode(f).hasPropertyWrite(prop, 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
|
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.
|
* A utility class that is equivalent to `boolean` but does not require type joining.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user