JS: More precise model of .shift()

Array.prototype.shift only returns the first array element.

The mutation of Argument[this] is not yet modelled, and is better handled when we have use-use flow.
This commit is contained in:
Asger F
2024-09-11 10:48:59 +02:00
parent e4f7560bcd
commit 3fcf4ef7a1

View File

@@ -484,7 +484,7 @@ class Shift extends SummarizedCallable {
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
preservesValue = true and
input = "Argument[this].ArrayElement" and
input = "Argument[this].ArrayElement[0]" and
output = "ReturnValue"
}
}