JavaScript: Add test for custom API-graph entry points.

This commit is contained in:
Max Schaefer
2020-09-03 16:15:48 +01:00
parent 58702e4c52
commit cb433a0c0f
5 changed files with 13 additions and 0 deletions

View File

@@ -20,6 +20,14 @@
import javascript
class CustomEntryPoint extends API::EntryPoint {
CustomEntryPoint() { this = "CustomEntryPoint" }
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("CustomEntryPoint") }
override DataFlow::Node getARhs() { none() }
}
private DataFlow::Node getNode(API::Feature nd, string kind) {
kind = "def" and
result = nd.getARhs()

View File

@@ -0,0 +1 @@
library-tests/ApiGraphs/VerifyAssertions.ql

View File

@@ -0,0 +1 @@
module.exports = CustomEntryPoint.foo; /* use (member foo (CustomEntryPoint)) */

View File

@@ -0,0 +1,3 @@
{
"name": "custom-entry-point"
}