Skip to content

Commit 5c7e623

Browse files
committed
JS: Add some tests for missing handling of dynamic args in flow summaries
1 parent c04f0be commit 5c7e623

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| library-tests/FlowSummary/tst.js:278 | expected an alert, but found none | NOT OK | ConsistencyConfig |
2+
| library-tests/FlowSummary/tst.js:282 | expected an alert, but found none | NOT OK | ConsistencyConfig |
3+
| library-tests/FlowSummary/tst.js:283 | expected an alert, but found none | NOT OK | ConsistencyConfig |
4+
| library-tests/FlowSummary/tst.js:286 | expected an alert, but found none | NOT OK | ConsistencyConfig |
5+
| library-tests/FlowSummary/tst.js:287 | expected an alert, but found none | NOT OK | ConsistencyConfig |
6+
| library-tests/FlowSummary/tst.js:290 | expected an alert, but found none | NOT OK | ConsistencyConfig |
7+
| library-tests/FlowSummary/tst.js:291 | expected an alert, but found none | NOT OK | ConsistencyConfig |

javascript/ql/test/library-tests/FlowSummary/tst.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,26 @@ function m17() {
268268
sink(value); // NOT OK
269269
}
270270
}
271+
272+
function m18() {
273+
const staticParam0 = mkSummary("Argument[0]", "ReturnValue");
274+
const staticParam1 = mkSummary("Argument[1]", "ReturnValue");
275+
const dynamicParam0 = mkSummary("Argument[0..]", "ReturnValue");
276+
const dynamicParam1 = mkSummary("Argument[1..]", "ReturnValue");
277+
278+
sink(staticParam0(...source())); // NOT OK
279+
sink(staticParam0("safe", ...source())); // OK
280+
sink(staticParam0(source(), ...["safe"])); // NOT OK
281+
282+
sink(staticParam1(...source())); // NOT OK
283+
sink(staticParam1("safe", ...source())); // NOT OK
284+
sink(staticParam1(source(), ...["safe"])); // OK
285+
286+
sink(dynamicParam0(...source())); // NOT OK
287+
sink(dynamicParam0("safe", ...source())); // NOT OK
288+
sink(dynamicParam0(source(), ...["safe"])); // NOT OK
289+
290+
sink(dynamicParam1(...source())); // NOT OK
291+
sink(dynamicParam1("safe", ...source())); // NOT OK
292+
sink(dynamicParam1(source(), ...["safe"])); // OK
293+
}

0 commit comments

Comments
 (0)