JavaScript: Make configuration IDs explicit in the API.

This commit is contained in:
Max Schaefer
2018-12-13 10:54:00 +00:00
parent 8f1c5db8be
commit e960bd967f
2 changed files with 8 additions and 2 deletions

View File

@@ -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 = ""
}

View File

@@ -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.
*/