mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
JavaScript: Make configuration IDs explicit in the API.
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
import javascript
|
||||
|
||||
/**
|
||||
* Holds if `config` matches `spec`, that is, either `spec` is the name of `config`
|
||||
* Holds if `config` matches `spec`, that is, either `spec` is the ID of `config`
|
||||
* or `spec` is the empty string and `config` is an arbitrary configuration.
|
||||
*/
|
||||
predicate configSpec(DataFlow::Configuration config, string spec) {
|
||||
config.toString() = spec
|
||||
config.getId() = spec
|
||||
or
|
||||
spec = ""
|
||||
}
|
||||
|
||||
@@ -86,6 +86,12 @@ abstract class Configuration extends string {
|
||||
bindingset[this]
|
||||
Configuration() { any() }
|
||||
|
||||
/**
|
||||
* Gets the unique identifier of this configuration among all data flow tracking
|
||||
* configurations.
|
||||
*/
|
||||
string getId() { result = this }
|
||||
|
||||
/**
|
||||
* Holds if `source` is a relevant data flow source for this configuration.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user