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:
Max Schaefer
2020-10-08 19:53:23 +01:00
parent b409cf6cea
commit 4bf6f6ac7c
4 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1 @@
import ApiGraphs.VerifyAssertions

View File

@@ -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))))) */
}

View File

@@ -0,0 +1,3 @@
{
"name": "property-read-from-argument"
}