mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
JavaScript: Add a negative test for API graphs.
The test ensures that flow summarization won't label property `f` of the first parameter of `assertNotNull` as a sink, which would be very imprecise.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
import ApiGraphs.VerifyAssertions
|
||||
@@ -0,0 +1,9 @@
|
||||
exports.assertNotNull = function (x) {
|
||||
if (x === null)
|
||||
throw new TypeError();
|
||||
}
|
||||
|
||||
exports.foo = function(x) {
|
||||
exports.assertNotNull(x);
|
||||
sink(x.f); /* !use (member f (parameter 0 (member assertNotNull (member exports (module property-read-from-argument))))) */ /* use (member f (parameter 0 (member foo (member exports (module property-read-from-argument))))) */
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "property-read-from-argument"
|
||||
}
|
||||
Reference in New Issue
Block a user