mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
Locally these seem to get rid of the compilation warnings, but of course CI is the true arbiter here.
18 lines
546 B
Plaintext
18 lines
546 B
Plaintext
/**
|
|
* Test that fails to compile if the domain of `SourceNode` depends on `SourceNode.flowsTo` (recursively).
|
|
*
|
|
* This tests adds a negative dependency `flowsTo --!--> SourceNode`
|
|
* so that the undesired edge `SourceNode --> flowsTo` completes a negative cycle.
|
|
*/
|
|
|
|
import javascript
|
|
|
|
overlay[local]
|
|
class BadSourceNode extends DataFlow::SourceNode {
|
|
BadSourceNode() { this.(DataFlow::PropRead).getPropertyName() = "foo" }
|
|
|
|
override predicate flowsTo(DataFlow::Node node) { not node instanceof DataFlow::SourceNode }
|
|
}
|
|
|
|
select "Success"
|