mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JavaScript: Add test for custom API-graph entry points.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
library-tests/ApiGraphs/VerifyAssertions.ql
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = CustomEntryPoint.foo; /* use (member foo (CustomEntryPoint)) */
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "custom-entry-point"
|
||||
}
|
||||
Reference in New Issue
Block a user