JS: Use more types in DOM model

This commit is contained in:
Asger Feldthaus
2020-09-29 12:01:38 +01:00
parent 3dabff6b17
commit cad259fb83

View File

@@ -347,7 +347,11 @@ module DOM {
}
/** Gets a data flow node that may refer to a value from the DOM. */
DataFlow::SourceNode domValueRef() { result = domValueRef(DataFlow::TypeTracker::end()) }
DataFlow::SourceNode domValueRef() {
result = domValueRef(DataFlow::TypeTracker::end())
or
result.hasUnderlyingType("Element")
}
module LocationSource {
/**
@@ -419,5 +423,9 @@ module DOM {
/**
* Gets a reference to the 'document' object.
*/
DataFlow::SourceNode documentRef() { result = documentRef(DataFlow::TypeTracker::end()) }
DataFlow::SourceNode documentRef() {
result = documentRef(DataFlow::TypeTracker::end())
or
result.hasUnderlyingType("Document")
}
}